Course menuSAA-C03

Exams / SAA-C03 / IAM roles and policies / Question 1

SAA-C03 practice question: IAM roles and policies (1 of 3)

Design Secure Architectures A free question from our original SAA-C03 practice exam. Try it, then open the answer to see why each option is right or wrong.

A logistics company runs a nightly invoicing application on Amazon EC2 instances in an Auto Scaling group. The application reads delivery records from one Amazon S3 bucket and writes finished invoices to a second bucket. Other applications run in the same VPC and must not be able to use either bucket. The security team bans long-term access keys on instances and in code, and wants permissions kept to the minimum the application needs. Which solution meets these requirements MOST securely?

Choose one answer.

  1. A. Create an IAM user with a policy for both buckets, store its access key in AWS Secrets Manager, and have the application fetch the key at startup.
  2. B. Attach an instance profile to the launch template with an IAM role that allows s3:GetObject on the source bucket and s3:PutObject on the invoice bucket.
  3. C. Attach an instance profile to the launch template with an IAM role that has the AWS managed AmazonS3FullAccess policy, so the application can reach both buckets.
  4. D. Create an S3 gateway endpoint, and add bucket policies that allow any principal whose requests arrive through that endpoint, so the instances need no credentials.
Show the answer and explanation

Answer: B

Explanation

An IAM role attached through an instance profile is the standard way to give an EC2 application AWS permissions without long-term keys: the credentials are temporary and rotate automatically. Scoping the role's policy to s3:GetObject on the source bucket and s3:PutObject on the invoice bucket keeps permissions to the minimum and keeps other workloads in the VPC out, which a network-only condition cannot do.

Study

Keep practising

Answer questions with a score at the end, or practise just this topic with the explanation after each one. No sign-up needed.