Technically, you can assume multiple IAM roles at the same time but the permissions will not be aggregated. Assuming an IAM role doesn't change who you are or what permissions you have.
When you assume a role, you are given a new set of temporary credentials to use, instead of "your" credentials -- the credentials you used to assume the role.
When interacting with AWS resources each request can only be associated with a singular principal. So, if you assume role1 and role2 you can make requests as role1 OR role2 but not as both together. So, if you are trying to perform a single action that requires an aggregate of the permissions of multiple roles, that's a not possible.
Another approach could involve session policies. See: Create fine-grained session permissions using IAM managed policies.
- asked 10 months ago
- Accepted Answerasked 2 years ago
- How can I use IAM roles to restrict API calls from specific IP addresses to the AWS Management Console?AWS OFFICIALUpdated a year ago
- Can I use a single CloudFront web distribution to serve content from multiple origins using multiple behaviors?AWS OFFICIALUpdated a year ago
- Can I use EBS Multi-Attach volumes to turn on multiple EC2 instances to simultaneously access a standard file system?AWS OFFICIALUpdated 4 months ago
- AWS OFFICIALUpdated 6 months ago
- EXPERTpublished 15 days ago