AWS Certified SysOps Administrator – Associate (legacy) — Question 532

An application is running on an Amazon EC2 instance. A SysOps Administrator is tasked with allowing the application access to an Amazon S3 bucket.
What should be done to ensure optimal security?

Answer options

Correct answer: C

Explanation

Using an IAM role for EC2 instances is the AWS-recommended best practice because it eliminates the need to manage, rotate, and store long-term AWS credentials on the instance. Hardcoding credentials in an AMI or injecting them via scripts introduces security risks of credential exposure, while a broad bucket policy allowing access to all EC2 instances violates the principle of least privilege.