Python Classroom notes 14/Sep/2024

Using Python for Cloud Automations

  • AWS Provides an SDK in python referred as boto3
  • Lets create a virtual environment with boto3 installed
  • Refer Here for boto3 docs
  • For the application credentials we need access keys and secret key, configure as discussed in the class.
  • To communicate with AWS we have to create client (low level apis) or Resource object (High level apis).

Activity 1: Start ec2 instance or stop a specific ec2 instance

Activity 2: Get all the ec2 instances in every region with a tag Env = Dev

  • get all the valid regions in my account using boto3
  • get all ec2 instances of the region and perform action
  • Refer Here for changes

Exercise

  • Rotate IAM Credentials for a specific user
  • Delete s3 bucket with name
  • stop the rds instance

Serverless

  • Refer Here for serverless
  • Advantage:
    • charged only when code is executing
    • Scaling is handled by AWS
  • Lets write a simple lambda function which adds two numbers

Published
Categorized as Uncategorized Tagged

By continuous learner

devops & cloud enthusiastic learner

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Please turn AdBlock off
Animated Social Media Icons by Acurax Responsive Web Designing Company

Discover more from Direct DevOps from Quality Thought

Subscribe now to keep reading and get access to the full archive.

Continue reading

Visit Us On FacebookVisit Us On LinkedinVisit Us On Youtube