Interview Prep/AWS/Global Infrastructure and IAM Basics

What is an instance profile?

BeginnerConceptGlobal Infrastructure and IAM Basics
Answer

An instance profile is the container that passes an IAM role to an EC2 instance. The console hides it by creating a same-named profile, but the CLI and CloudFormation expose it (AWS::IAM::InstanceProfile). The instance reads rotating credentials from the metadata service at /latest/meta-data/iam/security-credentials/<role>.

aws ec2 associate-iam-instance-profile --instance-id i-0abc \
  --iam-instance-profile Name=app-role
aws All AWS questions Roadmap: AWS core services

More on Global Infrastructure and IAM Basics