A developer is configuring an AWS Step Functions state machine that will write logs to Amazon CloudWatch Logs, write data directly to an Amazon DynamoDB table, and send notifications to an Amazon SNS topic. The developer is creating an IAM role for the state machine to grant the necessary permissions.
Which two configuration steps must the developer perform to successfully and securely configure this IAM role? (Select two.)
- Configure the trust policy of the IAM role to allow the states.amazonaws.com service principal to assume the role.Answer
- Attach a permissions policy to the IAM role that grants permissions for dynamodb:PutItem, sns:Publish, and CloudWatch Logs write actions on the specific target resource ARNs.Answer
- CConfigure the trust policy of the IAM role to allow the dynamodb.amazonaws.com and sns.amazonaws.com service principals to assume the role.
- DAttach a permissions policy to the IAM role that grants the sts:AssumeRole permission to the DynamoDB and SNS service principals.
- EStore permanent AWS access keys in the Step Functions state machine definition to authenticate API calls to DynamoDB and SNS.
Answer
Configure the trust policy of the IAM role to trust the Step Functions service principal (states.amazonaws.com) and attach a permissions policy that grants access to the specific DynamoDB table, SNS topic, and CloudWatch Logs target resources.
To successfully run the Step Functions state machine with the necessary permissions, two parts of the IAM role configuration are required. First, the trust policy must trust the Step Functions service principal ('states.amazonaws.com') to allow it to assume the role. Second, the permissions policy attached to the role must grant the required access to the target DynamoDB table, SNS topic, and CloudWatch Logs resource ARNs.
Step-by-Step Solution
Key Concept
IAM execution roles consist of a trust policy (defining which principal can assume the role) and a permissions policy (defining what actions that role can perform on which resources).
Estimated Time:1m 30s