Yes, if you have access to IAM get user then that will return ARN for the user which has Account ID. Simply call: 'aws iam get-user' would return,
{
"User": {
"UserName": "test",
"PasswordLastUsed": "2015-01-18T11:08:07Z",
"CreateDate": "2014-10-21T20:30:04Z",
"UserId": "AIDAXXXXXXXXXXXXX",
"Path": "/",
"Arn": "arn:aws:iam::123456789012:user/test"
}
}
Hope this helps!
Want to become AWS Expert? Come & join AWS Certification.