StudyToCert

All certifications / Developer Associate / Lessons

AWS Certified Developer – Associate DVA-C02 · Domain 2: Security

Cross-account access with STS AssumeRole and trust policies; temporary credentials

▶ Watch the overview video

Last reviewed October 6, 2026 · Leer en español

Explain it simpler

Companies often keep separate AWS accounts, like separate houses for testing and for real customers. Sometimes a program in one house needs to do a job in another. Instead of handing it a permanent key to the second house, the second house sets up a role, which is a job description with a list of allowed tasks, plus a note saying who may take that job. The program asks a token service for a temporary pass to that role. The pass works for a limited time, usually an hour, then expires. Both sides must agree: the second house must trust the program, and the program must be allowed to ask. It is like a contractor getting a day pass at a front desk instead of a permanent key.

Kenji maintains the deployment pipeline at Copperline Games. The build system lives in a tools account, and production lives in a separate, locked-down account. Today the security team sends a message: an audit found an IAM user named deploy-bot in production whose access keys are four years old and stored as a pipeline secret. They want it gone by Friday, with no loss of deployments. Kenji wonders how the pipeline can deploy into an account where it has no user at all, and how anyone will later tell which pipeline run made which change.

Organizations run many AWS accounts, and applications often need to reach resources in another account: a build pipeline deploying to production, a reporting job reading a data account's bucket, or a central monitoring tool collecting metrics. The standard, secure way to do this is for the caller to assume a role in the target account and receive short-lived credentials. Creating IAM users with long-term access keys in every account is the pattern the exam wants you to replace, because those keys never expire on their own, must be rotated by hand, and are easy to leak.

Free account

Keep reading for free

Create a free StudyToCert account to read the rest of this lesson: 6 more sections, 7 key terms, a real-world example, an exam tip and self-check questions. Every lesson, lab and practice test is free with an account.

Sign up free Log in

Study Developer Associate for free
A week-by-week plan with every lesson, quizzes, checkpoint tests, a practice exam and hands-on labs.
Open the Developer Associate study plan