An application running on an Amazon EC2 instance needs to securely access files in an Amazon S3 bucket. According to AWS security best practices, which IAM entity should be attached to the EC2 instance to grant these permissions without storing long-term credentials?
- AAn IAM group
- An IAM roleAnswer
- CAn IAM user
- DThe AWS account root user
Answer
An IAM role
The correct answer is an IAM role because IAM roles are designed to delegate permissions to AWS services, applications, or users without requiring long-term security credentials. By attaching an IAM role (specifically via an instance profile) to an Amazon EC2 instance, AWS automatically manages and rotates temporary credentials for the application to access Amazon S3.
Step-by-Step Solution
Key Concept
IAM Roles for AWS Services