AWS Certified Developer – Associate — Question 406

A developer is testing a Docker-based application that uses the AWS SDK to interact with Amazon DynamoDB. In the local development environment, the application has used IAM access keys. The application is now ready for deployment onto an ECS cluster.
How should the application authenticate with AWS services in production?

Answer options

Correct answer: A

Explanation

Using an ECS task IAM role is the AWS-recommended best practice for granting permissions to ECS containers, as it adheres to the principle of least privilege and avoids managing long-lived credentials. Hardcoding or using environment variables for IAM access keys poses a significant security risk and is not recommended for production. Refactoring the application to manually assume a role is unnecessary because the AWS SDK automatically handles credential retrieval when an ECS task role is attached.