A developer is implementing an AWS Lambda function in Account A () that needs to assume a specific IAM role named `TargetTaskRole` within the same account to perform administrative tasks. The Lambda function is configured with an execution role named `LambdaExecutionRole`.
The current trust policy of `TargetTaskRole` is configured as follows:
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Principal": {
"Service": "lambda.amazonaws.com"
},
"Action": "sts:AssumeRole"
}
]
}
During execution, the function code calls `sts:AssumeRole` for `TargetTaskRole` and fails with the following error:
`An error occurred (AccessDenied) when calling the AssumeRole operation: User: arn:aws:sts::123456789012:assumed-role/LambdaExecutionRole/my-function is not authorized to perform: sts:AssumeRole on resource: arn:aws:iam::123456789012:role/TargetTaskRole`
Which of the following configurations are required to resolve this error? (Select TWO.)
- Add a permissions policy to the execution role `LambdaExecutionRole` that allows the `sts:AssumeRole` action on `arn:aws:iam::123456789012:role/TargetTaskRole`.Cevap
- Update the trust policy of `TargetTaskRole` to add the execution role ARN `arn:aws:iam::123456789012:role/LambdaExecutionRole` as a trusted principal.Cevap
- CUpdate the trust policy of `LambdaExecutionRole` to allow the `sts:AssumeRole` action on `arn:aws:iam::123456789012:role/TargetTaskRole`.
- DModify the Lambda function code to initialize the AWS SDK client using static AWS access keys and secret keys generated for `TargetTaskRole`.
- EConfigure the trust policy of `TargetTaskRole` to allow the AWS Security Token Service (`sts.amazonaws.com`) as a trusted principal.