DOP-C02 Security and Compliance Practice Question
A DevOps engineer needs to grant an IAM user temporary access to an S3 bucket for exactly one hour. Which AWS service should be used to generate temporary credentials?
⚠ Common exam trap
DOP-C02 often tests the confusion between IAM (which defines permissions) and STS (which issues temporary credentials) — candidates pick IAM because it 'manages access' without realizing IAM cannot generate session tokens.
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
✓
AWS STS
AWS STS (Security Token Service) is the service that issues temporary, limited-privilege credentials via APIs like AssumeRole, GetSessionToken, and GetFederationToken. To grant an IAM user one-hour access to an S3 bucket, the engineer calls AssumeRole (or AssumeRoleWithSAML/WebIdentity) with a DurationSeconds of 3600 and attaches a scoped policy. STS returns an access key, secret key, and session token that expire automatically, which is exactly the temporary-credential requirement.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✗
Amazon Cognito
Why it's wrong here
Amazon Cognito is an identity platform for external users, not a tool for issuing temporary credentials to an existing IAM user. While Cognito identity pools can hand out temporary AWS credentials for unauthenticated or federated app users by assuming an IAM role, those credentials are scoped to the identity pool's role and are meant for application-level access, not for granting a specific IAM user time-limited permissions. For a straightforward IAM user needing temporary access, you would call AWS STS APIs instead of integrating with Cognito's user pools or identity pools.
- ✗
AWS SSO
Why it's wrong here
AWS SSO (now IAM Identity Center) is a centralized portal that provides access to multiple AWS accounts and cloud applications, but it is not the service that directly generates temporary credentials for a single IAM user. Behind the scenes, SSO uses AWS STS to create short-lived sessions after a user authenticates, yet it manages user assignments and permission sets, not the credential-issuing API for an existing IAM principal. For a DevOps engineer needing to grant an IAM user temporary access, the correct action is to use STS directly, not configure SSO to create a different access path.
- ✓
AWS STS
Why this is correct
AWS STS is the correct service for generating temporary credentials for an IAM user. APIs like GetSessionToken and AssumeRole return an access key ID, secret access key, and a session token that is valid for a specified duration (from 15 minutes up to 36 hours). The temporary credentials carry the same permissions as the IAM user's existing permissions (in the case of GetSessionToken) or the permissions defined in the assumed role's policy, making it ideal for short-lived access without rotating long-term keys.
- ✗
AWS IAM
Why it's wrong here
AWS IAM is the service that defines and manages permanent identities, such as users, groups, and roles, along with their attached policies and long-term access keys. It does not directly issue temporary credentials; instead, it provides the permission boundaries and role definitions that STS uses to produce time-limited credentials. While IAM is essential for configuring what permissions exist, the actual act of generating temporary access tokens is handled by the AWS STS API, so simply using IAM would not satisfy the requirement for temporary access.
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
This DOP-C02 question is part of Courseiva's 1,298-question bank — original exam-style content with full explanations and wrong-answer analysis, never real exam questions or exam dumps. Learn why practice questions differ from exam dumps →
JA
Written and reviewed by Johnson Ajibi, MSc IT Security
Senior Network & Security Engineer · founder of Courseiva
Last reviewed September 2026 · checked against the official Amazon Web Services exam blueprint
This DOP-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 DOP-C02 exam.