SAP-C02 Design for New Solutions Practice Question
A company is designing a new application that will run on Amazon ECS with Fargate. The application needs to store files in Amazon S3. The company has a strict security requirement that the application must not have any long-term credentials stored in the container image or environment variables. Which THREE steps should the company take to meet this requirement? (Choose THREE.)
⚠ Common exam trap
Watch out — candidates often think storing credentials in AWS Secrets Manager (Option A) is acceptable because it removes them from the image, but the requirement explicitly prohibits any long-term credentials from being present in the container at runtime, which Secrets Manager retrieval still introduces.
Answer choices
Why each option matters
Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.
Correct answer & explanation
✓
Create an IAM role with permissions to access the S3 bucket.
The application must not have long-term credentials stored in the container image or environment variables. By creating an IAM role with permissions to access the S3 bucket and attaching it as the ECS task role (Option C), the application can obtain temporary credentials from the ECS task metadata endpoint. This eliminates the need to store any static access keys. Option D is also correct because the ECS task execution role must have the `iam:PassRole` permission to allow the task role to be associated with the container, enabling the credential retrieval mechanism.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✗
Store AWS access keys in AWS Secrets Manager and retrieve them at runtime.
Why it's wrong here
This still requires credentials to access the secret.
- ✓
Create an IAM role with permissions to access the S3 bucket.
Why this is correct
The task role will assume this role to get temporary credentials.
- ✓
Attach the IAM role to the ECS task definition as the task role.
Why this is correct
The taskRoleArn in the task definition enables the container to assume the role.
- ✓
Enable the ECS task execution role to pass the task role to the container.
Why this is correct
The execution role grants ECS permission to pass the task role.
- ✗
Configure the application to use the AWS CLI with environment variables for credentials.
Why it's wrong here
Environment variables are long-term credentials, violating the requirement.
Quick reference
AWS S3 Storage Class Comparison
| Storage Class | Min Duration | Retrieval | Use Case |
|---|---|---|---|
| S3 Standard | None | Immediate | Frequently accessed data |
| S3 Standard-IA | 30 days | Immediate | Infrequent access, rapid retrieval |
| S3 One Zone-IA | 30 days | Immediate | Non-critical infrequent data |
| S3 Intelligent-Tiering | None | Immediate–hours | Unknown or changing access patterns |
| S3 Glacier Instant | 90 days | Milliseconds | Archive with instant retrieval |
| S3 Glacier Flexible | 90 days | Minutes–hours | Archive, flexible retrieval |
| S3 Glacier Deep Archive | 180 days | Hours | Long-term compliance archive |
Go deeper
Related to this question
About these practice questions
Courseiva writes every SAP-C02 question from scratch — 1,660 in total, each with an explanation and a wrong-answer breakdown. None are copied from real exams or dumps. Learn why practice questions differ from exam dumps →
JA
Written by Johnson Ajibi, MSc IT Security
Senior Network & Security Engineer · founder of Courseiva
This SAP-C02 practice question is part of Courseiva's free Amazon Web Services certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the SAP-C02 exam.