A SysOps administrator wants to automate the remediation of unencrypted Amazon EBS volumes. The administrator creates an Amazon EventBridge rule that triggers when an EBS volume is created. The target of the rule is the Systems Manager Automation document `AWS-DeleteVolume` to remove the unencrypted volume. The automation document requires an IAM service role to execute the deletion.
Which configuration and IAM permissions are required for the EventBridge rule to successfully trigger the remediation?
- Associate an IAM role with the EventBridge rule target that trusts `events.amazonaws.com`. Attach a policy to this role that grants `ssm:StartAutomationExecution` for the Systems Manager document and `iam:PassRole` for the Systems Manager service role.Answer
- BAssociate an IAM role with the EventBridge rule target that trusts `ssm.amazonaws.com`. Attach a policy to this role that grants `ssm:StartAutomationExecution` for the Systems Manager document and `iam:AssumeRole` for the Systems Manager service role.
- CConfigure the Systems Manager Automation document as the target directly. Attach a resource-based policy to the Systems Manager document that allows the `events.amazonaws.com` service principal to run the `ssm:StartAutomationExecution` action.
- DAssociate an IAM role with the EventBridge rule target that trusts `events.amazonaws.com`. Attach a policy to this role that grants `ssm:StartAutomationExecution` for the Systems Manager document, and update the Systems Manager service role's trust policy to trust `events.amazonaws.com`.
Answer
Associate an IAM role with the EventBridge rule target that trusts `events.amazonaws.com`. Attach a policy to this role that grants `ssm:StartAutomationExecution` for the Systems Manager document and `iam:PassRole` for the Systems Manager service role.
The correct configuration requires associating an IAM role with the EventBridge rule target that trusts the EventBridge service principal (`events.amazonaws.com`). This role must have a policy attached that allows `ssm:StartAutomationExecution` to run the remediation document and `iam:PassRole` to pass the service role that Systems Manager will assume to perform the deletion.
Step-by-Step Solution
Key Concept
To execute Systems Manager Automation from an EventBridge rule target, EventBridge requires an IAM execution role that trusts the `events.amazonaws.com` service principal. This role must have identity-based permissions allowing `ssm:StartAutomationExecution`. If the automation runbook specifies an IAM service role to execute its API calls, the EventBridge execution role must also have `iam:PassRole` permissions for that service role.
Estimated Time:1m 30s