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 comment

Turn on JavaScript to leave a comment.

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

Please turn AdBlock off
Social Media Icons Powered by Acurax Web Design Company
Exit mobile version
%%footer%%