Coder Social home page Coder Social logo

aws-boto3-scripts's Introduction

aws-boto3-scripts

Python scripts for AWS using boto3 SDK

Script Description
ec2_start.py Start all instances with a specific tag
ec2_stop.py Stop all instances with a specific tag
ec2_ip_route53.py Get EC2 public IP and change Route53 'A' record
ec2_start_and_route53.py Start EC2, get public IP and change Route53 'A' record

Installation

Requires Python and boto3.

git clone https://github.com/dmitrijsf/aws-boto3-scripts
cd aws-boto3-scripts
pip install -r requirements.txt

Usage

Set desired AWS credentials

In this example I am using aws-vault to work with desired profile.

❯ aws-vault add home
Enter Access Key ID: your-aws-access-key-id
Enter Secret Access Key: your-aws-access-key
Added credentials to profile "home" in vault

# launches subshell with desired AWS environment variables
❯ aws-vault exec -- home

Launching Scripts

❯ cd scripts
# modify the script according to your needs
# ec2_ip_route53.py

# set instance ID
instance_id = 'i-0111112233' # Instance ID, e.g. 'i-0111112233'
# set Hosted Zone ID
zone_id = 'ZBDAAABBBCCC' # Hosted Zone ID, e.g. 'ZBDAAABBBCCC'
# domain
domain = 'technoff.eu' # Domain, e.g. technoff.eu

❯ ./ec2_ip_route53.py
technoff.eu record was changed to: 52.51.120.202

aws-boto3-scripts's People

Contributors

defo89 avatar dmitrijsf avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.