An organization needs to automatically stop any Amazon EC2 instance that fails an AWS Config security compliance check. A SysOps administrator wants to route these compliance changes to a Systems Manager Automation document named AWS-StopEC2Instance to remediate the issue. Which two configuration actions are required to set up this automation pipeline?
- Configure an Amazon EventBridge rule with an event pattern matching AWS Config Compliance Change events, and set the target to the Systems Manager Automation document.Answer
- Create an IAM role with a trust policy for the EventBridge service principal (events.amazonaws.com) and a policy allowing the ssm:StartAutomationExecution action, then assign it to the EventBridge rule.Answer
- CConfigure an AWS Config remediation action directly within the AWS Config rule using the EventBridge event pattern as the target.
- DCreate an IAM policy with sts:AssumeRole for the EC2 instance profile, and attach it to the EventBridge rule without configuring Systems Manager permissions.
- ECreate a Systems Manager Event Rule within the Systems Manager console to poll AWS Config compliance logs stored in Amazon S3.
Answer
To establish the automated remediation pipeline, you must configure an Amazon EventBridge rule matching AWS Config compliance changes targeting the Systems Manager Automation document, and assign an IAM role to the EventBridge rule allowing the ssm:StartAutomationExecution action.
Establishing this remediation pipeline requires two primary parts: defining the event routing and establishing the correct permissions. The event pattern matching AWS Config Compliance Change events correctly filters for non-compliant resources to trigger the target Automation document. The IAM role containing the trust relationship for the EventBridge service principal and the permission to start automation executions satisfies the access requirements.
Step-by-Step Solution
Key Concept
Automated remediation using Amazon EventBridge rules to trigger AWS Systems Manager Automation documents, requiring appropriate IAM execution permissions.