Bad error message if instance profile assume role policy is wrong
- Dominant language
- Python
- Stars
- 17.3k
- Forks
- 4.6k
- Avg merge
- 1d 2h
- Merged PRs (30d)
- 13
Description
We had an instance profile with a misconfigured role - the assume role policy didn't permit ec2.amazonaws.com. awscli gets very confusing:
```
ubuntu@i-7b4dc7eb:~$ aws --region us-east-1 ec2 describe-instances
'AccessKeyId'
ubuntu@i-7b4dc7eb:~$
```
It'd be nice if awscli could return the helpful error message from the meta-data API:
```
ubuntu@i-7b4dc7eb:~$ curl http://169.254.169.254/latest/meta-data/iam/security-credentials/testing-node-role
{
"Code" : "AssumeRoleUnauthorizedAccess",
"Message" : "EC2 cannot assume the role testing-node-role. Please see documentation at http://docs.amazonwebservices.com/IAM/latest/UserGuide/RolesTroubleshooting.html.",
"LastUpdated" : "2016-07-11T18:09:39Z"
}
```
Thanks,
Ross
Contributor guide
Assessment
This issue has not been assessed yet.