Git Product home page Git Product logo

dockerswitchawsec2's Introduction

Docker API to manage on/off AWS EC2 instances

  • Creation of API based on Docker to manage AWS EC2 instances on/off.

Demonstration

Prerequisite

  1. Install docker on ubunu.
  2. Manage Docker as a non-root user.
  3. Install docker compose on ubunu.

How to use

  1. Rename .env.example as .env.

  2. Set the enviromental variables:

    AWS_ACCESS_KEY_ID=XXX
    AWS_SECRET_ACCESS_KEY=XXX
    AWS_SESSION_TOKEN=XXX
    REGION_NAME=XXX
  3. Deploy the containers

    docker compose up -d
  4. Stop the containers

    docker comopose down

How to develop

  1. Modify docker-compose.yml file:

    • From this line:
    image: sflorenz05/api-aws-mngmt:v0.1
    • To this line:
    build: api-ec2/
  2. Repository structure

    • API-EC2
    /api-ec2
        |_ /api
            |_ main.py
                |_ status_ec2.py
                |_ start_ec2.py
                |_ stop_ec2.py
    • Swagger
      • Modify *.json file to e.g., introduce new endpoints:
    /swagger
        |_ swagger.json
  3. Introduce new endpoints or improve improve existing ones

    1. Crete/modify the endpoint in main.py file.
    2. Crete/modify the fuctionality through files such as start_ec2.py.

dockerswitchawsec2's People

Contributors

sfl0r3nz05 avatar

Stargazers

 avatar  avatar

Watchers

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