AWS Developer DVA-C02 · Security · medium
An AWS Lambda function in Account A (111122223333) needs to read objects from an Amazon S3 bucket in Account B (444455556666) by assuming an IAM role named arn:aws:iam::444455556666:role/CrossAccountS3Reader in Account B. When the Lambda function calls the AWS STS AssumeRole API, what does AssumeRole return, and how must the two accounts' IAM policies be configured?
Published · Last updated · checked before publication — how we verify questions
Options
Answer: B. Returns temporary AccessKeyId, SecretAccessKey, and SessionToken via Trust Policy
sts:AssumeRole returns a set of temporary security credentials consisting of an AccessKeyId, SecretAccessKey, and SessionToken (valid for 15 minutes to 12 hours). For cross-account role assumption to succeed, Account A's Lambda execution role must have an identity-based policy allowing sts:AssumeRole on Account B's role ARN, AND Account B's role must have a Trust Policy (AssumeRolePolicyDocument) allowing Account A's principal to assume it.
Why the other options are wrong
- A. Returns a permanent root X.509 cert; disables IAM in Account B — STS never returns root certificates or disables IAM.
- C. Returns a Cognito User Pool JWT password hash; requires VPC Peering between Account A and B — STS AssumeRole operates over the IAM/STS control plane without VPC peering or Cognito passwords.
- D. Returns an unencrypted KMS master key; requires an S3 Bucket ACL set to public-read-write — Cross-account STS role assumption keeps the S3 bucket completely private.
More Security questions
- A central platform security team allows application developers to create their own IAM execution roles for AWS Lambda…
- A mobile fitness app needs: (1) a managed user directory supporting sign-up, sign-in, MFA, and social login (Sign in…
- A regulated enterprise stores files in an Amazon S3 bucket encrypted with an AWS KMS Customer Managed Key (SSE-KMS)…
- A developer needs to encrypt a 50 MB sensitive PDF file locally on an application server before uploading it to an…
AWS and Amazon Web Services are trademarks of Amazon.com, Inc. PrepIQ Hub is not affiliated with, endorsed by, or sponsored by Amazon Web Services.