SAA-C03 · Question #438
A company wants to migrate applications from its on-premises servers to AWS. As a first step, the company is modifying and migrating a non-critical application to a single Amazon EC2 instance. The app
The correct answer is C. Create an IAM role that has the necessary access to Amazon S3. Attach the role to the EC2. The best practice for granting AWS service access to EC2 instances is to assign IAM roles with the least privilege necessary. IAM roles attached to EC2 instances provide temporary credentials automatically rotated by AWS, avoiding hard-coded credentials in the application code. O
Question
A company wants to migrate applications from its on-premises servers to AWS. As a first step, the company is modifying and migrating a non-critical application to a single Amazon EC2 instance. The application will store information in an Amazon S3 bucket. The company needs to follow security best practices when deploying the application on AWS. Which approach should the company take to allow the application to interact with Amazon S3?
Options
- ACreate an IAM role that has administrative access to AWS. Attach the role to the EC2 instance.
- BCreate an IAM user. Attach the AdministratorAccess policy. Copy the generated access key and
- CCreate an IAM role that has the necessary access to Amazon S3. Attach the role to the EC2
- DCreate an IAM user. Attach a policy that provides the necessary access to Amazon S3. Copy the
How the community answered
(38 responses)- A5% (2)
- B3% (1)
- C89% (34)
- D3% (1)
Explanation
The best practice for granting AWS service access to EC2 instances is to assign IAM roles with the least privilege necessary. IAM roles attached to EC2 instances provide temporary credentials automatically rotated by AWS, avoiding hard-coded credentials in the application code. Option C adheres to security best practices by assigning an IAM role scoped with the minimum permissions needed to access the S3 bucket. Option A grants administrative access, which violates least privilege principles. Options B and D use IAM users with static credentials, increasing the risk of credential exposure and requiring manual rotation, which is not recommended.
Community Discussion
No community discussion yet for this question.