AWS in 1 Min · Episode 33

AWS cross-account access with IAM roles explained

Share a role, not a user. Watch the one-minute video, then read the details.

David Gomez1:12 video · 3 min read

"Working in another account needs a new user there." That is the slow, risky way. Every extra user is another password and maybe another access key, and nobody remembers to delete them. AWS has a better tool: cross-account access, where an identity in one account borrows a role in another.

The idea

Accounts are isolated by default. Cross-account access lets a user, role or application in Account A use resources in Account B without having a second identity in B. There are two ways to do it: with an IAM role, or with a resource-based policy.

With a role

  1. Account B (which owns the resources) creates a role and attaches permissions to it, for example read access to one bucket.
  2. The role's trust policy names who may use it: Account A, or better, one specific role in Account A.
  3. Account A gives its own user or role permission to call sts:AssumeRole on that role's ARN.
  4. The user assumes the role. AWS Security Token Service returns temporary credentials that expire on their own.

Both sides must agree. If the trust policy allows Account A but nobody in A is allowed to call sts:AssumeRole, it fails. If A allows the call but B's trust policy doesn't name A, it fails too.

One detail surprises people: while using the role, the user gives up their original permissions and has only the role's. They are working as the role, in Account B.

With a resource-based policy

Some resources carry their own policy. An S3 bucket policy, an SNS topic policy or an SQS queue policy can name another account as a principal directly, with no role involved.

The difference matters in practice. With a resource-based policy the user keeps their own permissions in Account A while also reaching the resource in B, which is handy for copying data between accounts. The same rule about two sides applies: the resource policy must allow it and the user's own identity policy must allow it.

Not every service supports resource-based policies. When one doesn't, use a role.

Common mistakes

  • Trusting the whole account when you meant one role. A trust policy that names an account lets that account's administrators delegate the role to any of their principals. Narrow it where you can.
  • Third parties without an external ID. When a vendor's software assumes a role in your account, AWS recommends an external ID condition in the trust policy so the vendor can't be tricked into using your role on someone else's behalf.
  • Forgetting old trust. Roles that trust accounts you no longer work with are open doors. IAM Access Analyzer flags roles that can be assumed from outside your account or organization.

Where AI fits

Cross-account roles are a common way for many teams to share one central model account. Instead of every team enabling Amazon Bedrock in its own account, a platform team runs one account for model access. Each team's application assumes a role there and calls Bedrock with those temporary credentials.

What you get:

  • One place for access. The role's policy decides which models each team may invoke.
  • One place for quotas. Tokens-per-minute quotas are per account and Region, so capacity is requested and watched once. The flip side is that teams now share that capacity, so one noisy app can throttle the others.
  • One place for cost. Model spend lands in one account. To split it by team, AWS offers tools such as tagged application inference profiles; check the current Bedrock docs for what applies to your models.

Quick recap

  • Share a role, don't copy users.
  • The role's trust policy and the caller's own permissions must both allow it.
  • Credentials are temporary, and the user works with only the role's permissions.
  • Some resources, like S3 buckets, can grant another account access directly.
AWS in 1 Min #33 · 1:12

Need an AWS expert on your team?

I'm David, an AWS expert and fractional cloud consultant. I work alongside your team to run your cloud and infrastructure: architecture, security, cost and day-to-day operations. You get senior AWS experience when you need it, without the cost of a full-time hire.

  • Architecture reviews and a clear plan for what to fix first
  • Security hardening: IAM, networking, audits
  • Lower AWS bills without slowing your team down
  • Hands-on help with AI workloads on AWS