Python Real-time Project For Devops On Aws | Lambda Functions

Search for a command to run...

Where you are using the given python code? how you are triggerin it? I donot see the step here
🎬 The Story Picture this: You push code to GitHub. Five minutes later, your updated application is running in production—built, scanned for vulnerabilities, containerized, and deployed automatically. No manual steps. No human errors. Pure automation...
Building a Production-Ready GitOps CI/CD Pipeline: How Modern Companies Deploy Code 1000+ Times Per Day From Manual Deployments to Netflix-Level Automation 12 min read • DevOps • Cloud Native • Automation 🎯 The Problem Every Developer Faces Pictur...
When most people open VIM for the first time, the reaction is almost universal: “Why is this so confusing?” I felt the same—until I changed how I thought about it. VIM isn’t a typical text editor. It’s closer to cloud architecture than a traditional ...

If you're preparing for a Linux Administrator interview, here's a question you'll likely hear: "How do you patch Linux servers without internet access?" This is one of the most common interview questions, and for good reason – it's a real-world scena...

Introduction Have you ever encountered a "Permission denied" error while trying to access a file on Linux? Or wondered what those cryptic rwxr-xr-- characters mean when you run ls -l? Understanding Linux file permissions is fundamental to working wit...

As a Cloud Engineering team we take care of the AWS environment and make sure it is in compliance with the organizational policies. We use AWS cloud watch in combination with AWS Lambda to govern the resources according to the policies. For example, we Trigger a Lambda function when an Amazon Elastic Block Store (EBS) volume is created. We use Amazon CloudWatch Events. CloudWatch Events that allows us to monitor and respond to EBS volumes that are of type GP2 and convert them to type GP3.
GitHub Repo: https://github.com/saadkhan024/Volume_gp2-to-gp3
Go to search bar and type lambda and click on lambda under service as show below.

Then we will select create function and put the details as shown on image.
Under Function name you can give any name as per your requirement.
and under Runtime you have to select Python.

For Permission we are going with default option, you can also create an IAM role with set of permission for lambda creation.

Once we give the permission just hit create function and it will create the function.

You have to click on Test and and under that you will find Configure test event.

After clicking on configure test event you have to given the basic details as show on below image and just click on save.

Once you configure the test you check the function by executing test key.

In this section we will configure cloud watch rule which will trigger the Lambda function.
Go to search bar and type cloud watch and select cloud watch under services.

Go to Event on the left side panel and click on Rule.

Once you click on Rules you have to click on Create Rules and follow the same which is mention below in the diagram.





For selecting the target follow the below step and click on next.

Go to Ec2 Dashboard and see below the volume section click on it create one
volume for testing purpose.
And select gp2 partition as we are going to convert the same into gp3

Created a Volume.

You can see that Lambda function got triggered.

Now we will write Python code to convert volume gp2 to gp3


You fill find the roles like below, click on it and attach the policy to it.
Kindly select Create inline policy.


I am going with all the permission as it is demo one. you can restrict the access.

Provide the Policy Name and click on Create

Now we will delete the volume which we have created as policy will triggered wen we create a Volume, so for that we required to create one.
Created new volume let see if policy has been triggered or not.

