Automated Patch Management and EBS Backup for EC2 Instances on AWS

Project Overview

Automate the weekly patching of EC2 instances and daily backup of EBS volumes through snapshots, including the removal of old snapshots, to meet the client’s requirements for a more secure and maintainable infrastructure.

Technologies and Services Used

  • AWS: EC2, EBS, Systems Manager (Patch Manager, Maintenance Windows), Lambda, CloudWatch Events

  • Automation: AWS Systems Manager, AWS Lambda, Snapshot Lifecycle Management

  • Security and Compliance: Patch Baselines, Compliance Reporting, Automated Snapshot Retention

Key Responsibilities:

  • Assessment and Requirements Gathering: - Evaluated the client’s existing AWS environment, which included 8 EC2 instances across multiple regions. - Identified the need for automated patch management and daily EBS volume backups, with a policy to retain snapshots for 30 days.

  • Automation Setup Using AWS Systems Manager: - Patch Management Automation: Configured AWS Systems Manager to automate weekly patching of the EC2 instances. Created a Systems Manager Maintenance Window and Patch Manager task to run the patch job on all instances every week. - Patch Baselines: Defined custom patch baselines to specify which updates should be applied, ensuring that critical and security patches were prioritized. - Patch Compliance Reporting: Set up Systems Manager to generate compliance reports, allowing the client to review the patch status of all EC2 instances.

  • Automated EBS Backup and Retention Policy: - Snapshot Automation: Developed an AWS Lambda function and scheduled it using Amazon CloudWatch Events to take daily snapshots of all EBS volumes attached to the EC2 instances. - Snapshot Retention Management: Extended the Lambda function to automatically delete snapshots older than 30 days, ensuring that storage costs were controlled while maintaining compliance with the client’s data retention policy.

  • Testing and Validation: - Test Environment Setup: Created a test environment to validate the automated patching process and snapshot creation and deletion. Ensured that the patching process did not disrupt the normal operation of the instances. - Backup and Restoration Testing: Conducted tests to confirm that EBS snapshots were successfully created and could be used to restore volumes in case of data loss or corruption.

  • Documentation and Handover: - Comprehensive Documentation: Documented the entire automation process, including the Systems Manager setup, Lambda function code, and CloudWatch Events configuration. Provided detailed instructions for monitoring and managing the automation. - Client Training: Conducted a handover session with the client’s IT team, demonstrating how to monitor the automated patching and backup processes and adjust settings as needed.

Project Outcomes

Successfully implemented an automated solution for weekly patch management and daily EBS backups, meeting the client’s requirements for enhanced security and operational efficiency. The automated deletion of old snapshots ensured that storage costs were minimized while maintaining data availability and compliance.

Latest Projects

Things I do

CLOUD

Amazon Web Services

AZURE Cloud

Google Cloud Platform

IBM Cloud

DevOps Tools

Jenkins

Ansible for software provisioning

Packer for automated machine images

AWS CodePipeline

AWS CodeDeploy

Azure Pipelines

Chef

Github Actions

GitLab CI/CD

CircleCI

Microservices

Kubernetes

Docker

AWS ECS

AWS EKS

AKS

Azure Container Apps

Monitoring and Alerting

Telegraf

Prometheus

Grafana

Pagerduty

Infrastructure as Code

CloudFormation

Terraform

AWS CDK (Python & Typescript)

Operating System

Most of Linux Server Distributions

Window Server 2019/2022

Databases

MySQL

MariaDB

MongoDB

PostgreSQL

MSSQL

Scripting

Shell Scripting

Python

YAML

PowerShell

My Certifications

EMAIL: RAJ412214@GMAIL.COM

Let's Talk

Book a call to talk regarding the current vacancy at your organization.