-
My deploy code (in python) creates a new ec2 instance using:
As you can see, I use an existing IAM role to spin up this ec2 instance. In the documentation for the
Why does it create an IAM instance profile even though I have already specified an IAM role? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
That's not a role, it's an InstanceProfile. EC2 instances can have a "profile", which describes the set of roles that are used by that instance (as an instance can be made up of the permissions of several roles, into one meta-role). This is the mechanism by which roles are passed to the EC2 instance overall. It's outlined in the ClouddFormation docs: https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ec2-instance.html#cfn-ec2-instance-iaminstanceprofile |
Beta Was this translation helpful? Give feedback.
-
Hello! Reopening this discussion to make it searchable. |
Beta Was this translation helpful? Give feedback.
That's not a role, it's an InstanceProfile.
EC2 instances can have a "profile", which describes the set of roles that are used by that instance (as an instance can be made up of the permissions of several roles, into one meta-role). This is the mechanism by which roles are passed to the EC2 instance overall.
It's outlined in the ClouddFormation docs: https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ec2-instance.html#cfn-ec2-instance-iaminstanceprofile