Git Product home page Git Product logo

aws-shutdown-script's Introduction

AWS Shutdown Python Script

Get temporary sts credentials and shut down running instances on aws

Prequistes:

To run the script, you need to ensure that your environment meets the following requirements:

  1. Python Installed: You need to have Python installed on your system. The script is written in Python.

  2. AWS CLI Configuration: You should have AWS CLI configured with appropriate credentials and default region. You can configure it by running aws configure and providing your AWS access key, secret key, default region, and output format.

  3. Boto3 Installed: Install the boto3 library, which is the AWS SDK for Python. You can install it using pip:

    pip install boto3
    
  4. IAM Role and Permissions: Ensure that you have an IAM role set up in your AWS account with the necessary permissions (e.g., EC2 administration) and trust relationships for your AWS EC2 instances to assume this role.

  5. AWS Environment Variables (Optional): You can set environment variables for AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY, AWS_SESSION_TOKEN, and AWS_DEFAULT_REGION if you prefer not to use the AWS CLI configuration. These environment variables will override the CLI configuration if set.

  6. AWS CLI Tools: If you want to run the AWS CLI commands within the script (e.g., aws configure or aws sts assume-role), you need to have the AWS CLI tools installed.

Make sure to replace "arn:aws:iam::YOUR_ACCOUNT_ID:role/EC2AdminRole" with the actual ARN of your IAM role.

aws-shutdown-script's People

Contributors

franckya 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.