A developer is configuring an AWS Lambda function in Account A () to write data to an Amazon DynamoDB table in Account B (). The developer wants to use a cross-account IAM role named `DynamoDBWriterRole` in Account B to perform the DynamoDB operations. The Lambda function runs under an execution role named `LambdaExecutionRole` in Account A. Which two configurations are required to establish this cross-account trust and allow the Lambda function to write to the table? (Select TWO.)
- A trust policy attached to the role in Account B that specifies the Lambda execution role in Account A as the principal and allows the sts:AssumeRole action.Answer
- An IAM permissions policy attached to the Lambda execution role in Account A that allows the sts:AssumeRole action on the Amazon Resource Name (ARN) of the role in Account B.Answer
- CAn IAM permissions policy attached to the role in Account B that allows sts:AssumeRole for the dynamodb.amazonaws.com service principal.
- DFunction code changes to hardcode temporary AWS access keys generated from the Account B IAM console within the AWS SDK initialization.
- EA trust policy attached to the role in Account B that grants the sts:AssumeRole permission to the dynamodb.amazonaws.com service principal.
Answer
To configure cross-account access, the developer must attach a trust policy to the role in Account B that lists the Lambda execution role in Account A as a principal and allows the sts:AssumeRole action. In addition, the developer must attach an IAM permissions policy to the Lambda execution role in Account A allowing the sts:AssumeRole action on the target role's ARN in Account B.
Establishing cross-account delegation requires both sides to agree: the target role's trust policy in Account B must trust the calling IAM entity in Account A, and the calling identity in Account A must be granted permission in its identity policy to assume that target role.
Step-by-Step Solution
Key Concept
Cross-account IAM Role Delegation
Estimated Time:2m 0s