A company runs an application on an Amazon EC2 instance. The application needs to read and write items in an Amazon DynamoDB table. According to AWS security best practices, which approach should a solutions architect use to grant the application access to the DynamoDB table?
- Create an IAM role with the required DynamoDB permissions and attach it to the EC2 instance profile.Answer
- BConfigure the application to use the AWS account root user access keys to guarantee full access to the DynamoDB table.
- CCreate an IAM user with programmatic access keys, embed the keys directly inside the application's configuration files, and deploy the application.
- DStore the IAM user access keys as a plaintext parameter in Systems Manager Parameter Store and configure the application to retrieve them.
Answer
Create an IAM role with the required DynamoDB permissions and attach it to the EC2 instance profile.
Creating an IAM role and attaching it to the EC2 instance profile allows the application to automatically and securely obtain temporary credentials. This eliminates the need to manage, distribute, or rotate long-term credentials, adhering to AWS security best practices.
Step-by-Step Solution
Key Concept
AWS service authentication using IAM roles and instance profiles to avoid long-term credentials.