Courseiva
Design for New SolutionseasyMultiple SelectObjective-mapped

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 ClassMin DurationRetrievalUse Case
S3 StandardNoneImmediateFrequently accessed data
S3 Standard-IA30 daysImmediateInfrequent access, rapid retrieval
S3 One Zone-IA30 daysImmediateNon-critical infrequent data
S3 Intelligent-TieringNoneImmediate–hoursUnknown or changing access patterns
S3 Glacier Instant90 daysMillisecondsArchive with instant retrieval
S3 Glacier Flexible90 daysMinutes–hoursArchive, flexible retrieval
S3 Glacier Deep Archive180 daysHoursLong-term compliance archive

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 →

How Courseiva writes practice questions · Editorial policy

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.