An organization requires that any newly created Amazon EBS volume without encryption be immediately detached and deleted. A SysOps administrator sets up an Amazon EventBridge rule that triggers when an Amazon EC2 `CreateVolume` API call is recorded. The rule is configured with an AWS Systems Manager (SSM) Automation custom document as the target. The custom document uses an IAM service role named `RemediationExecutionRole` to perform the detachment and deletion. Although EventBridge detects the `CreateVolume` events, the SSM Automation workflow fails to start. Which of the following configuration adjustments will resolve this execution failure?
- AAttach an IAM policy with `ssm:StartAutomationExecution` permissions to the instance profile of the EC2 instances.
- BConfigure detailed monitoring on the EC2 instances to ensure that events are processed with a 1-minute granularity instead of 5-minute granularity.
- Add the `iam:PassRole` permission to the EventBridge execution role, targeting the `RemediationExecutionRole` Amazon Resource Name (ARN).Answer
- DModify the trust policy of the `RemediationExecutionRole` to allow the `events.amazonaws.com` service principal to assume the role.
Answer
Add the `iam:PassRole` permission to the EventBridge execution role, targeting the `RemediationExecutionRole` Amazon Resource Name (ARN).
The correct answer is to add the `iam:PassRole` permission to the EventBridge execution role, targeting the `RemediationExecutionRole` ARN. When Amazon EventBridge triggers an AWS Systems Manager (SSM) Automation execution that specifies a service role to perform its actions, the execution role of the EventBridge rule must have the permission to pass that service role to Systems Manager. Without `iam:PassRole` permission, the API call to start the automation execution will fail with an AccessDenied exception.
Step-by-Step Solution
Key Concept
AWS Systems Manager Automation remediation triggers via Amazon EventBridge require correct execution role configuration including `iam:PassRole` for the SSM Automation assume role.