Skip to main content

Deployment tool for Amazon ECS

Project description

Deployment tool for Amazon ECS.


pip install ecs-deplojo


Usage: ecs-deplojo [OPTIONS]

  --config FILENAME   [required]
  --var VAR
  --output-path PATH
  --role-arn <optional arn>
  --help              Show this message and exit.

Example configuration

cluster_name: example

    DATABASE_URL: postgresql://

    template: task_definitions/web.json
        memory: 512
          - hostPort: 0
            containerPort: 8080
            protocol: tcp
    template: task_definitions/manage.json

    task_definition: web

  - task_definition: manage
    container: uwsgi
    command: migrate --noinput

  - task_definition: manage
    container: uwsgi
    command: clearsessions

Using SSM secrets

When you want to use the AWS SSM secrets in your configuration you can use the secrets section, however this needs some additional configuration within AWS

At first you need an AWS IAM role to use as the ECS execution role, this role needs access to the secrets in Secrets Manager or Parameter store and will only be used during the startup of your Docker container.

Example configuration:

cluster_name: example

  NORMAL_ENV_VAR: value_of_variable

  DATABASE_URL: /path/to/secret/DATABASE_URL

    execution_role_arn: arn:aws:iam::<account_id>:role/execution_role_name
    template: task_definitions/web.json

    task_definition: web

When the container is started the secrets are available as environment variables and hidden in the AWS ECS console.

AWS Default VPC

When running your servers in the AWS default VPC you need networkMode="awsvpc" in your task definition JSON file, this will ensure that no hostnames are set for the containers, since this isn’t supported by AWS.

AWS Fargate

Unlike EC2 based clusters AWS Fargate needs a execution_role_arn to work, this can be set in your service definition in the YAML file.

Example log output

Starting deploy on cluster example (1 services)
Registered new task definition web:10
Starting one-off task ' migrate --noinput' via manage:10 (uwsgi)
Updating service web with task defintion web:10
Waiting for deployments
Waiting for services: web (0/2)
Waiting for services: web (1/2)
Waiting for services: web (2/2)
Deployment finished: web (2/2)
Starting one-off task ' clearsessions' via manage:10 (uwsgi)

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for ecs-deplojo, version 0.9.2
Filename, size File type Python version Upload date Hashes
Filename, size ecs_deplojo-0.9.2-py2.py3-none-any.whl (12.2 kB) File type Wheel Python version py2.py3 Upload date Hashes View
Filename, size ecs-deplojo-0.9.2.tar.gz (10.9 kB) File type Source Python version None Upload date Hashes View

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Huawei Huawei PSF Sponsor Microsoft Microsoft PSF Sponsor NVIDIA NVIDIA PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page