Skip to content

ogulcanaydogan/AWSAutoRemediation

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 

Repository files navigation

AWSAutoRemediation

Implementing Auto-Remediation in AWS: A Step-by-Step Guide

In the ever-evolving world of cloud computing, maintaining the stability of production environments is crucial. I recently embarked on a project that aimed to do just that. The goal was straightforward: to build an auto-remediation solution that would automatically correct any accidental changes made to our AWS EC2 Auto Scaling Groups (ASG). Here's how I did it.

Step 1: Identifying the Issue The first step in any project is to understand the problem. Our team noticed that junior engineers, still learning the ropes, occasionally changed the desired capacity of our production ASG to 0. This caused outages that we wanted to avoid.

Step 2: Designing the Solution With the problem in mind, we designed a solution leveraging AWS services. The concept was to create a system that would automatically detect and correct any undesired changes, particularly the scaling down of our production environment.

Step 3: Setting Up the Environment Using a 'multiple environment to a single AWS account' approach, we set up separate environments for production and development. This allowed for isolation of changes and a secure way to test our auto-remediation without impacting production.

Step 4: Implementing Triggers We used AWS CloudWatch to monitor the state of our ASG. If a change occurred that set the desired capacity to 0, CloudWatch would trigger an alarm.

Step 5: Writing the Lambda Function In response to the CloudWatch alarm, an AWS Lambda function was invoked. This function contained the logic to assess whether the change was intentional or not. If it was identified as an accidental change, the function would reset the desired capacity to its previous state.

Step 6: Testing the System Before going live, we rigorously tested the system in our development environment. We simulated the accidental changes and ensured that the Lambda function behaved as expected, correcting the desired capacity of the ASG automatically.

Step 7: Deployment and Monitoring After successful tests, we deployed the auto-remediation system into production. We continued to monitor the system using AWS CloudWatch, ensuring that it corrected any issues without manual intervention.

Step 8: Review and Iterate Finally, we reviewed the system's performance, documenting any incidents it corrected and refining the Lambda function as needed to ensure it accurately distinguished between intended and unintended changes.

Conclusion The implementation of this auto-remediation system not only minimized outages but also served as a valuable learning tool for our engineers. It highlighted the importance of automation in maintaining the reliability and stability of our cloud infrastructure.

By sharing these steps, I hope to provide a roadmap for others facing similar challenges in their cloud environments. The journey through DevOps is one of continuous improvement, and this project was a testament to that ethos.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published