Skip to content

Script for automating the process of creating a ec2 instance with ecs container

License

Notifications You must be signed in to change notification settings

RusherRG/aws-ecs-automation

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

aws-ecs-automation

Script for automating the process of creating a ec2 instance with ecs container to run a small task on different instances

How to use:

  • Add the following configuration details in conf:

    • ACCESS_KEY and SECRET_KEY: AWS credentials
    • KEY: name of the pem file
    • REGION: ec2 instance region
    • INSTANCE_TYPE: instance flavor (eg. t2.small, t3.medium, etc.)
    • LAUNCH_TYPE: EC2 or Fargate
    • VPC and SUBNET for the ec2 instance
  • Run parsers.py

python3 parsers.py --aws <instance_type> --docker <docker_image> --entrypoint_args <args for docker entrypoint>
  • Voilà! an ECS cluster is created using a randomized cluster name. This cluster creates a ec2 instance of the specified instance flavour. A docker is deployed on the instance using the docker compose file generated by parsers.py.

  • After 60 secs, the instance is terminated and the cluster is deleted. If you want to delay the process of cleanup you can increase the sleep time in create_ec2_instance.sh or you can comment out the cleanup function in case you don't want to run the cleanup process.

About

Script for automating the process of creating a ec2 instance with ecs container

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published