Security & ComplianceQuestion 30 of 100

An application running on an EC2 instance needs to read objects from an S3 bucket. What is the recommended way to grant this access?

a.Embed long-term access keys in the application code
b.Make the S3 bucket public
c.Attach an IAM role to the EC2 instance
d.Share the root user credentials with the instance

Explanation

Attaching an IAM role to the EC2 instance provides temporary, automatically rotated credentials to the application, avoiding hard-coded keys. This follows the principle of least privilege and is far more secure than embedding static keys.

Practice all 100 questions free — no signup required.

Related questions on this topic

Last reviewed: · editorial process

PrepPass Editorial Team · Verified against AWS Certified Cloud Practitioner (CLF-C02) · How we review
Report