Skip to content

A Python script that requests a spot EC2 instance

Notifications You must be signed in to change notification settings

danlabici/auto-aws-ec2-spot

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

auto-aws-ec2-spot

A Python script that requests a spot EC2 instance. Using tag name to control specific instance.

Prerequisites

Setup

Boto 3 Install

$ pip install boto3

AWS CLI Configure

  • Create Access Key for Your AWS Account. Instructions can be found at https://docs.aws.amazon.com/general/latest/gr/managing-aws-access-keys.html

  • Configure AWS CLI using AWS Access Key ID and AWS Secret Access Key

    • $ aws configure
    • AWS Access Key ID [None]: 'ACCESS_KEY_ID'
      AWS Secret Access Key [None]: 'SECRET_ACCESS_KEY'
      Default region name [None]:'Region'
      Default output format [None]: ENTER

Configuration File

List of a configure fields

*Refer to example-config.cfg file.

Request EC2 Spot Instance

python main.py start CONFIG_FILE_NAME.cfg

Terminate EC2 Spot Instance

python main.py stop CONFIG_FILE_NAME.cfg

List EC2 Instances

python main.py list CONFIG_FILE_NAME.cfg

About

A Python script that requests a spot EC2 instance

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 98.8%
  • Shell 1.2%