A SysOps Administrator needs to implement automated compliance remediation to stop any Amazon EC2 instance that is found to be non-compliant with the AWS Config managed rule `ec2-instance-no-public-ip`. The administrator wants the compliance check and the remediation to happen automatically with the least operational overhead.
Which approach should the administrator take to meet these requirements?
- AConfigure the AWS Config rule to publish compliance status changes to an Amazon Simple Notification Service (Amazon SNS) topic, and set the Systems Manager Automation document as a direct subscriber to the topic.
- BCreate an Amazon EventBridge rule that filters for AWS Config compliance change events, and configure the target of the EventBridge rule as the AWS Config rule to execute the remediation workflow.
- Associate the Systems Manager Automation document `AWS-StopEC2Instance` as a remediation action directly within the AWS Config rule, enable automatic remediation, and select the resource ID parameter mapping.Answer
- DAssociate the Systems Manager Automation document `AWS-StopEC2Instance` as a remediation action in the AWS Config rule, and assign the EC2 instance profile's IAM execution role directly to AWS Config without `iam:PassRole` permissions.
Answer
Associate the Systems Manager Automation document `AWS-StopEC2Instance` as a remediation action directly within the AWS Config rule, enable automatic remediation, and select the resource ID parameter mapping.
The correct option is to associate the Systems Manager Automation document directly within the AWS Config rule, enable automatic remediation, and map the resource ID. This uses the native automated remediation capability of AWS Config, which directly triggers the SSM Automation document whenever a resource is evaluated as non-compliant.
Step-by-Step Solution
Key Concept
AWS Config native automated remediation leverages Systems Manager Automation documents to automatically correct non-compliant resources using resource ID mappings.
Estimated Time:1m 30s