到目前为止我已经能够顺利运行
aws sts assume-role --role-arn arn:aws:iam::<accountID>:role/<iam_role> --role-session-name <a_session_name> --profile <the_profile_name>
...
现在我收到错误
An error occurred (AccessDenied) when calling the AssumeRole operation: User: arn:aws:sts::<accountID>:assumed-role/<iam_role>/botocore-session-xxxxx is not authorized to perform: sts:AssumeRole on resource: arn:aws:iam::<accountId>:role/<iam_role>
这是因为我处于假设角色状态然后尝试再次假设相同角色吗?如果是这种情况那么清除 botocore 缓存的解决方案是什么?
aws sts get-caller-identity --profile picklerick
给我带来了相同的结果:arn:
和userId
都附加了相同的botocore-session-xxxxx
这些问题不是这个问题的重复:
如果这些对你来说有意义,那么你也可以首先解释一下是什么原因造成的 - 到目前为止我没有遇到任何问题,从来没有关心或看到过 boto 的提及
我认为这里的问题是 IAM 角色不再隐式信任自己,因此您需要调整信任策略以将角色本身添加到列表中。对于和我有同样问题的人,你可以阅读以下博客文章。
https://aws.amazon.com/blogs/security/announcing-an-update-to-iam-role-trust-policy-behavior/