Skip to main content

Deployment tool for Amazon ECS

Project description

Deployment tool for Amazon ECS.

Installation

pip install ecs-deplojo

Usage

Usage: ecs-deplojo [OPTIONS]

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

Example configuration

---
cluster_name: example

environment:
    DATABASE_URL: postgresql://

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

services:
  web:
    task_definition: web

before_deploy:
  - task_definition: manage
    container: uwsgi
    command: manage.py migrate --noinput

after_deploy:
  - task_definition: manage
    container: uwsgi
    command: manage.py 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

environment:
  NORMAL_ENV_VAR: value_of_variable

secrets:
  DATABASE_URL: /path/to/secret/DATABASE_URL

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

services:
  web:
    task_definition: web

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

Example log output

Starting deploy on cluster example (1 services)
Registered new task definition web:10
Starting one-off task 'manage.py 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 'manage.py 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.

Source Distribution

ecs-deplojo-0.9.1.tar.gz (10.3 kB view details)

Uploaded Source

Built Distribution

ecs_deplojo-0.9.1-py2.py3-none-any.whl (11.9 kB view details)

Uploaded Python 2 Python 3

File details

Details for the file ecs-deplojo-0.9.1.tar.gz.

File metadata

  • Download URL: ecs-deplojo-0.9.1.tar.gz
  • Upload date:
  • Size: 10.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.47.0 CPython/3.7.7

File hashes

Hashes for ecs-deplojo-0.9.1.tar.gz
Algorithm Hash digest
SHA256 898b9e0c0691a79657b7be9ab58107eaf94739e70c07c64e88732a250ba38622
MD5 ab55ee4dc2ee4e2c9f84d1f19e087024
BLAKE2b-256 91089ffb0bdeb1972763c3361154284e661c18def2743339870d752568c3f373

See more details on using hashes here.

File details

Details for the file ecs_deplojo-0.9.1-py2.py3-none-any.whl.

File metadata

  • Download URL: ecs_deplojo-0.9.1-py2.py3-none-any.whl
  • Upload date:
  • Size: 11.9 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.47.0 CPython/3.7.7

File hashes

Hashes for ecs_deplojo-0.9.1-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 9623da0c7d41056a0f3f1e8400dc9167c5229e481aa100e15b668aa69a4043d5
MD5 22cec4bfdaf8df76770505ecc72f820a
BLAKE2b-256 a524806250a096f3ac0b1b33930daceac33699acc81d869e3b6abce4134745fb

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page