EC2 instance roles Flashcards
What is the main purpose of using IAM roles?
In general, IAM roles are the best practice ways for services to be granted permissions.
What do EC2 Instance roles do?
EC2 instance roles are roles that an instance can assume and anything
running in that instance has the permissions that role grants.
How do EC2 instance roles work?
An IAM role must be defined with a permissions policy.
Then the EC2 instance role allows the EC2 service to assume that role.
What is the instance profile and what does it do?
The instance profile is the item that allows the permissions to get inside the instance. When you create an instance role in the console, an instance profile is created with the same name.
Once an IAM role is assumed, how are credentials passed through to the instance?
Via the meta-data.
Do the credentials provided to the instance as result of assuming a role expire?
EC2 and the secure token service ensure the credentials never expire.
Mention some key facts about credentials inside meta-data:
Credentials can be found in iam/security-credentials/role-name
Credentials are automatically rotated - always valid - as long as that role is attached to the
Why are roles important?
Because you should always use roles compared to storing long term credentials (for example, access keys…).
Do CLI tools use role credentials automatically?
Yes.