A company is deploying a containerized application on Amazon EC2 instances. The application requires access to an Amazon DynamoDB table to retrieve configuration settings. The developer proposes creating a new IAM user, generating long-term access keys, and embedding them in the application's configuration file. Which solution should a solutions architect recommend to establish secure access while adhering to the principle of least privilege?
- Create an IAM role with a permissions policy that allows access to the DynamoDB table, attach this role to the EC2 instances using an instance profile, and configure the application to use the AWS SDK to retrieve temporary credentials automatically.Cevap
- BCreate an IAM user with the required DynamoDB permissions, store the access keys in Systems Manager Parameter Store as a plaintext String parameter, and configure the application to retrieve these credentials at startup.
- CCreate a standard String parameter in Systems Manager Parameter Store containing the AWS account root user's access keys, and configure the EC2 instances to retrieve these credentials at startup.
- DCreate individual IAM users for each EC2 instance, and configure a SAML 2.0 identity provider to dynamically federate these user credentials for database access.
Cevap
Create an IAM role with a permissions policy that allows access to the DynamoDB table, attach this role to the EC2 instances using an instance profile, and configure the application to use the AWS SDK to retrieve temporary credentials automatically.
The correct solution uses an IAM role attached to the EC2 instances via an instance profile. This is the recommended security best practice because it eliminates the need to manage, store, or rotate long-term AWS credentials. The AWS SDK running inside the EC2 instances automatically retrieves temporary security credentials from the Instance Metadata Service (IMDS) to perform the authorized actions on DynamoDB.
Adım Adım Çözüm
Anahtar Kavram
EC2 Instance Profiles and IAM Roles
Tahmini Süre:1m 30s