An application running on an EC2 instance failed when trying to read from an S3 bucket. The developer discovered that the EC2 instance's associated IAM role lacked S3 read permissions. What is the least disruptive way to grant the application the required read access?
Choose an answer
Tap an option to check your answer.
Correct answer: Add the S3 read permission to the IAM role; the role change will take effect immediately for the running instance..
Why this is the answer
The correct answer is to add the S3 read permission to the IAM role because changes to an IAM role attached to an EC2 instance are propagated almost immediately to the running instance. There is no need to restart, stop, or terminate the instance for the new permissions to take effect. Terminating and launching a new instance is disruptive and unnecessary. Hibernating and restarting the instance is also disruptive and not required. Adding a bucket policy to the S3 bucket would grant access but is not the most secure or manageable way to grant permissions to an EC2 instance. Instance profiles are the preferred method for managing EC2 instance permissions, and modifying the associated role is the most efficient solution.
Pass your exam — without the endless answer hunt
Get every verified question and explanation for this exam in one place, and save hours of prep. 1,000+ certifications · 20+ languages · free to start.
Pass your exam faster → No card needed