An administrator needs to configure an application running on an Amazon EC2 instance to read files from an Amazon S3 bucket. According to AWS security best practices, which approach should the administrator use to grant the EC2 instance the necessary permissions?
- ACreate an IAM user with S3 read permissions, generate access keys, and embed them in the application code running on the EC2 instance.
- BGenerate access keys for the AWS account root user and store them in a configuration file on the EC2 instance.
- Create an IAM role with S3 read permissions and associate it with the EC2 instance.Answer
- DSubmit a request to AWS Support to manage and configure the permissions for the EC2 instance's access to the S3 bucket.
Answer
Create an IAM role with S3 read permissions and associate it with the EC2 instance.
Associating an IAM role with the EC2 instance is the recommended practice because it delegates temporary credentials to the instance. This prevents the need to manage, store, or rotate static access keys on the instance itself.
Step-by-Step Solution
Key Concept
IAM Roles for AWS Services