CloudMormation IAM Role - AssumeRolePolicyDocument

So, I am creating a cf stack for a role in AWS, and I do not know how to do this in the AssumeRolePolicyDocument field when developing a non-resource based role.

All the examples I tried to view have a specific AWS resource specified in the "Principal" field (for example, "Service": "ec2.amazonaws.com" ).

What is the correct way to use the AssumeRolePolicyDocument field for roles intended for users and not resources?

+5
source share
1 answer

You can specify the AWS IAM user using the AWS key instead of Service as the Principal for the role policy document, including AssumeRolePolicyDocument:

 "Principal": { "AWS": "arn:aws:iam::AWS-account-ID:user/user-name" } 

For more information, see Principal Specification in IAM Policy Elements.

+3
source

Source: https://habr.com/ru/post/1263625/


All Articles