An AWS Lambda function is configured with an execution role named `LambdaProcessingRole`. The role has the following identity-based permission policy attached:
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": [
"dynamodb:PutItem",
"sns:Publish"
],
"Resource": "*"
}
]
}
Additionally, the developer has attached an IAM Permissions Boundary named `DeveloperBoundary` to the role. The policy document for the permissions boundary is:
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": [
"dynamodb:*",
"s3:*"
],
"Resource": "*"
}
]
}
During execution, the Lambda function successfully writes items to the Amazon DynamoDB table, but attempts to publish messages to the Amazon SNS topic fail with an `AccessDeniedException` error.
Which of the following modifications is required to resolve this authorization failure?
- AModify the IAM trust policy of the Lambda execution role to allow sns.amazonaws.com to assume the role.
- Update the permissions boundary policy (DeveloperBoundary) to include the sns:Publish action.Answer
- CHardcode the AWS credentials of an IAM User with AdministratorAccess in the initialization of the SNS client inside the Lambda code.
- DConfigure a Cognito Identity Pool to authenticate the Lambda function and exchange the user tokens for temporary AWS credentials that have SNS publish permissions.