SAP-C02 Design for New Solutions Practice Question
A company is designing a new application that will run on Amazon EC2 instances. The application needs to access an Amazon S3 bucket to read and write objects. The company wants to ensure that the EC2 instances can access the S3 bucket without storing AWS credentials on the instances. Which TWO steps should the company take?
⚠ Common exam trap
It's easy for candidates to confuse network-level controls (security group outbound rules) with authentication/authorization mechanisms, thinking that allowing outbound traffic to S3 is sufficient to grant access, when in fact the instance still needs valid IAM credentials to authenticate requests to S3.
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
✓
Attach the IAM role to the EC2 instance profile.
An IAM role can be attached to an EC2 instance via an instance profile, allowing the instance to obtain temporary credentials from the AWS Security Token Service (STS) without storing any long-term credentials on the instance. This is the recommended secure method for granting EC2 instances access to AWS services like S3.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✓
Attach the IAM role to the EC2 instance profile.
Why this is correct
Attaching the role to the instance profile allows the instance to assume the role.
- ✗
Store the AWS access key and secret access key in a configuration file on the instance.
Why it's wrong here
Storing credentials on instances is a security risk.
- ✗
Create an S3 bucket policy that allows access from the EC2 instance's IP address.
Why it's wrong here
IP-based policies are not best practice and may not work if instances have elastic IPs.
- ✗
Configure the EC2 security group to allow outbound traffic to S3.
Why it's wrong here
Security groups control network traffic but do not grant IAM permissions.
- ✓
Create an IAM role with a policy that grants the required S3 permissions.
Why this is correct
IAM role provides temporary credentials via the instance profile.
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
One of 1,660 original SAP-C02 practice questions on Courseiva, each with a full explanation and wrong-answer analysis — not exam dumps or protected exam content. 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.