- Creation of API based on Docker to manage AWS EC2 instances on/off.
- Check this youtube link for a video demonstration.
-
Rename
.env.example
as.env
. -
Set the enviromental variables:
AWS_ACCESS_KEY_ID=XXX AWS_SECRET_ACCESS_KEY=XXX AWS_SESSION_TOKEN=XXX REGION_NAME=XXX
-
Deploy the containers
docker compose up -d
-
Stop the containers
docker comopose down
-
Modify
docker-compose.yml
file:- From this line:
image: sflorenz05/api-aws-mngmt:v0.1
- To this line:
build: api-ec2/
-
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:
- Modify
/swagger |_ swagger.json
-
Introduce new endpoints or improve improve existing ones
- Crete/modify the endpoint in
main.py
file. - Crete/modify the fuctionality through files such as
start_ec2.py
.
- Crete/modify the endpoint in