ECS-ComposeX

ECS ComposeX

PYPI_VERSION GitHub

CodeStyle TDD with pytest BDD with Behave

Codecov Code scan with SonarCloud

BUILD

Build your infrastructure and deploy your services to AWS services using docker-compose file format.

Install

pip install ecs_composex

Usage


usage: ecs-composex [-h] {up,render,create,config,init,version} ...

positional arguments:
  {up,render,create,config,init,version}
                        Command to execute.
    up                  Generates & Validates the CFN templates,
                        Creates/Updates stack in CFN
    render              Generates & Validates the CFN templates locally. No
                        upload to S3
    create              Generates & Validates the CFN templates locally.
                        Uploads files to S3
    config              Merges docker-compose files to provide with the final
                        compose content version
    init                Initializes your AWS Account with prerequisites
                        settings for ECS
    version             ECS ComposeX Version

optional arguments:
  -h, --help            show this help message and exit
CLI for up and render
usage: ecs_composex up [-h] -n NAME -f DOCKERCOMPOSEXFILE [-d OUTPUTDIRECTORY]
                       [--format {json,yaml,text}] [--region REGIONNAME]
                       [--az ZONES] [-b BUCKETNAME] [--use-spot-fleet]

optional arguments:
  -h, --help            show this help message and exit
  -n NAME, --name NAME  Name of your stack
  -f DOCKERCOMPOSEXFILE, --docker-compose-file DOCKERCOMPOSEXFILE
                        Path to the Docker compose file
  -d OUTPUTDIRECTORY, --output-dir OUTPUTDIRECTORY
                        Output directory to write all the templates to.
  --format {json,yaml,text}
                        Defines the format you want to use.
  --region REGIONNAME   Specify the region you want to build fordefault use
                        default region from config or environment vars
  --az ZONES            List AZs you want to deploy to specifically within the
                        region
  -b BUCKETNAME, --bucket-name BUCKETNAME
                        Bucket name to upload the templates to
  --use-spot-fleet      Runs spotfleet for EC2. If used in combination of
                        --use-fargate, it will create an additional SpotFleet
CLI for config
usage: ecs-composex config [-h] -f DOCKERCOMPOSEXFILE [-d OUTPUTDIRECTORY]

optional arguments:
  -h, --help            show this help message and exit
  -f DOCKERCOMPOSEXFILE, --docker-compose-file DOCKERCOMPOSEXFILE
                        Path to the Docker compose file
  -d OUTPUTDIRECTORY, --output-dir OUTPUTDIRECTORY
                        Output directory to write all the templates to.

Note

Each component can also use the docker-compose file but be deployed on its own, allowing, for production workloads, to deploy each component separately to avoid dependencies on each other.

Fargate First

However the original deployments and work on this project was done using EC2 instances (using SpotFleet mostly), everything is now implemented to work on AWS Fargate First (2020-06-06).

Note

If you do not need extra AWS resources such as SQS queues to be created as part of these microservices deployments, I would recommend to use AWS ECS CLI which does already a lot of the work for the services. Alternatively, use the AWS CLI v2. It is absolutely smashing-ly awesome and might be just what you need This tool aims to reproduce the original ECS CLI behaviour whilst adding logic for non ECS resources that you want to create in your environment.

License

  • Free software: GPLv3+

The Blog

Follow the news and technical articles on using ECS ComposeX on the Blog BLOG_RELEASE

Credits

This package would not have been possible without the amazing job done by the AWS CloudFormation team! This package would not have been possible without the amazing community around Troposphere! This package was created with Cookiecutter and the audreyr/cookiecutter-pypackage project template.