In cloud environments, compliance and configuration management are critical. One small misconfiguration; like an instance type that doesn’t meet your company’s standards, can lead to performance issues or unnecessary costs.
Recently, I set up an event-driven architecture on AWS that automatically evaluates the configuration of EC2 instances and triggers a remediation workflow when something’s off. In my case, the system sends me an email notification whenever an EC2 instance doesn’t meet the ideal configuration setting.
Here’s how I built it:
Step 1: Enabling AWS Config
I started by enabling AWS Config in my account. AWS Config continuously evaluates your resource configurations against defined rules, so it’s perfect for enforcing compliance standards.
Step 2: Setting Up SNS for Notifications
Next, I created an SNS topic to send alerts whenever a non-compliant resource is detected.
Then, I subscribed to the topic using my email address — so any time remediation is triggered, I’d get an instant notification in my inbox.
Step 3: Creating an IAM Role for Remediation
I created a dedicated IAM role that allows AWS Config’s automated remediation feature to publish messages to the SNS topic.
This step ensures that Config has the right permissions to trigger notifications.
Step 4: Defining the Config Rule
After that, I set up an AWS Config rule to check the instance type of my EC2 instances.
I specified that only instances of type t3.micro should be considered compliant.
Step 5: Setting Up Automated Remediation
Here’s where the magic happens — I configured automated remediation in AWS Config so that whenever a non-compliant instance is detected, AWS automatically executes an action (in this case, sending a message to SNS).
Step 6: Testing It Out
To test the setup, I launched an EC2 instance that wasn’t a t3.micro.
Within moments, I received an email notification alerting me that the instance didn’t meet the required configuration.
That confirmed my event-driven architecture was working exactly as intended.
Conclusion:
This project was a simple but powerful demonstration of how AWS services — like Config, SNS, and IAM — can work together to enforce compliance automatically in real-time.
Event-driven architectures like this save teams from hours of manual checks and ensure that your cloud environment stays secure and optimized.
If you’re looking to build a similar workflow, start with a small rule (like instance type) — and then scale up to include security groups, IAM policies, or even S3 bucket configurations.
Below is a simple architecture diagram showing how AWS Config evaluates EC2 instances, triggers remediation, and sends notifications through SNS.

Top comments (0)