AdministratorApril 19, 2020 at 1:54 am
Thank you for your reply. It is true that you cannot directly trigger a Lambda function from AWS Config. The AWS Lambda function in AWS Config is primarily used to evaluate whether your AWS resources comply with the rule or not. The remediation action is done via the AWS Systems Manager Automation. However, take note that you can call a Lambda from your Systems Manager workflow to terminate the EC2 instance:
I understand that the Systems Manager Automation document has an AWS-StopEC2Instance action that you can use to terminate the EC2 instances:
Same goes with Lambda:
I acknowledge that we can add more information on this option to avoid any misunderstanding like this in the future. I’ll revise the option to also mention Systems Manager Automation as part of the answer.
Let us know if you need further assistance. The Tutorials Dojo team is dedicated to help you pass your AWS exam on your first try!
Jon Bonso @ Tutorials Dojo