Security

IAM Role

An IAM role is an identity that can be assumed to obtain temporary credentials.

How it works

An IAM role is an AWS identity with permissions that trusted principals can assume to obtain temporary credentials. Its trust policy specifies who can assume it, while its permissions policies define what the role can do. EC2 workloads can use a role through an instance profile, avoiding embedded long-term access keys. Other applicable policies may further restrict access.

When to use it

Choose it when the requirement is access for EC2, Lambda, or another account.

Real-world example

An application on an EC2 instance needs to read invoices from a private S3 bucket. An administrator associates an instance profile containing a suitably scoped role, and the application uses temporary credentials to request the permitted objects.

Key facts

  • A trust policy specifies which principals can assume the role.

Common pitfall

Do not confuse the role permissions policy with its trust policy. Granting S3 permissions is insufficient if the intended principal cannot assume the role under its trust policy and other applicable permissions.

References

Prepared by Cloud Quest. Check current behavior and limits in the AWS documentation:

SAA-C03 study guide and learning resources

Keywords you will see in SAA-C03 questions

  • instance profile
  • assume role

Understand it for real with 3D models and simulated labs

Connect the concept to a working architecture.

Start learning