A company has a fleet of Amazon EC2 instances that need to dynamically retrieve customer reports from a private Amazon S3 bucket. The lead developer wants to ensure that the application on these instances has secure, programmatic access without hardcoding credentials or exposing the account to security risks. Which approach aligns with the AWS-recommended best practice for granting this access?
- Create an IAM role with an attached policy allowing S3 read permissions, and associate this role with an EC2 instance profile.Cevap
- BCreate an IAM user, generate long-term access keys with S3 read permissions, and store them in the application configuration files on the EC2 instances.
- CUse the AWS account root user credentials to configure the AWS Command Line Interface (CLI) on each EC2 instance to guarantee uninterrupted bucket access.
- DSubmit a request to AWS Support asking them to configure the underlying hypervisor to allow the EC2 instances to bypass S3 bucket policies.
Cevap
Create an IAM role with an attached policy allowing S3 read permissions, and associate this role with an EC2 instance profile.
The correct approach is to create an IAM role with the appropriate S3 permissions and attach it to the EC2 instances using an instance profile. This allows the application on the EC2 instances to retrieve temporary security credentials dynamically, eliminating the need to store static, long-term access keys on the instance.
Adım Adım Çözüm
Anahtar Kavram
Identity and Access Management (IAM) Roles and Access Control Best Practices
Tahmini Süre:2m 0s