AWS Certified Solutions Architect – Associate (SAA-C02) — Question 196

An application running on an Amazon EC2 instance needs to access an Amazon DynamoDB table. Both the EC2 instance and the DynamoDB table are in the same AWS account. A solutions architect must configure the necessary permissions.
Which solution will allow least privilege access to the DynamoDB table from the EC2 instance?

Answer options

Correct answer: A

Explanation

The correct answer is A because creating an IAM role with the proper policy and assigning it through an instance profile grants the EC2 instance the necessary permissions without hardcoding credentials. Options B, C, and D either involve unnecessary complexity or security risks, such as managing IAM user credentials directly, which is not recommended for least privilege access.