nerdexam
Amazon

SAA-C03 · Question #129

A company uses a set of Amazon EC2 instances to host a website. The website uses an Amazon S3 bucket to store images and media files. The company wants to automate website infrastructure creation to…

The correct answer is C. Create an IAM role and an IAM access policy that allows the web server EC2 instances to access. The most secure solution for allowing EC2 instances to access an S3 bucket is by usingIAM roles. An IAM role can be created with an access policy that grants the required permissions (e.g., to read and write to the S3 bucket). The IAM role is then associated with the EC2…

Submitted by chiamaka_o· Mar 4, 2026Design Secure Architectures

Question

A company uses a set of Amazon EC2 instances to host a website. The website uses an Amazon S3 bucket to store images and media files. The company wants to automate website infrastructure creation to deploy the website to multiple AWS Regions. The company also wants to provide the EC2 instances access to the S3 bucket so the instances can store and access data by using AWS Identity and Access Management (IAM). Which solution will meet these requirements MOST securely?

Options

  • ACreate an AWS Cloud Format ion template for the web server EC2 instances. Save an IAM
  • BCreate a file that contains an IAM secret access key and access key ID. Store the file in a new S3
  • CCreate an IAM role and an IAM access policy that allows the web server EC2 instances to access
  • DCreate a script that retrieves an IAM secret access key and access key ID from IAM and stores

How the community answered

(38 responses)
  • A
    5% (2)
  • B
    11% (4)
  • C
    82% (31)
  • D
    3% (1)

Explanation

The most secure solution for allowing EC2 instances to access an S3 bucket is by usingIAM roles. An IAM role can be created with an access policy that grants the required permissions (e.g., to read and write to the S3 bucket). The IAM role is then associated with the EC2 instances through anIAM instance profile. By associating the role with the instances, the EC2 instances can securely assume the role and receive temporary credentials via the instance metadata service. This avoids the need to store credentials (such as access keys) on the instances or within the application, enhancing security and reducing the risk of credentials being exposed. AWS CloudFormation can be used to automate the creation of the entire infrastructure, including EC2 instances, IAM roles, and associated policies.

Community Discussion

No community discussion yet for this question.

Full SAA-C03 Practice