Data analysts with IAM identities in AWS account A need to run Amazon Athena queries against a data lake owned by account B. The security team in account B wants to grant access without creating any new IAM users and wants all access to use temporary credentials. What is the MOST appropriate approach?
Choose one.
Cross-account access in AWS is built on IAM roles and AWS STS: the resource-owning account defines a role and trust policy, and principals in the trusted account assume the role to receive temporary credentials.
An assumable role in account B satisfies every constraint. Account B controls the role's permissions and can revoke trust at any time; account A keeps managing its own people; and every session uses short-lived STS credentials that expire automatically. The alternatives either mint new long-term credentials (new IAM users, shared keys) or rely on ACLs, which are legacy, coarse, and not a credential-issuing mechanism at all.
- In account B, create a role with permissions for Athena, the Glue Data Catalog, and the underlying S3 data.
- Set the role's trust policy to allow the specific principals (or the account root with conditions) from account A to call sts:AssumeRole.
- In account A, grant the analysts permission to assume the role; they then run Athena queries using the temporary credentials from the assumed-role session.
Exam tip: For cross-account access, assume a role with STS - never duplicate users or distribute long-term keys across accounts.
Applying Authentication Mechanisms: IAM, Secrets Manager, and Networks — the lesson that teaches this.