Skip to main content

ECS Deploy

https://travis-ci.org/fabfuel/ecs-deploy.svg?branch=develop https://scrutinizer-ci.com/g/fabfuel/ecs-deploy/badges/coverage.png?b=develop https://scrutinizer-ci.com/g/fabfuel/ecs-deploy/badges/quality-score.png?b=develop

Redeploying a service in Amazon ECS causes some effort, even if you just want to pull the most recent image versions. You have to create a new revision of the task definition and update the service to use the newly created revision.

This project simplyfies deployments on Amazon ECS by providing a convinience CLI tool for actions, which are executed pretty often.

TL;DR

Redeploy or scale a service in Amazon ECS as simple as this:

$ ecs deploy my-cluster my-service --tag latest
$ ecs scale my-cluster my-service 4

Installation

The project is availably on PyPI. Simply run:

$ pip install ecs-deploy

Configuration

As ecs-deploy is based on boto3 (the official AWS Python library), there are several ways to configure and store the authentication credentials. Please read the boto3 documentation for more details (http://boto3.readthedocs.org/en/latest/guide/configuration.html#configuration). The simplest way is by running:

$ aws configure

Alternatively you can pass the AWS credentials (via –access-key-id and –secret-access-key) or the AWS configuration profile (via –profile) as options when you run ecs.

Actions

Currently the following actions are supported:

deploy

Redeploy a service either without any modifications or with a new image, environment variable and/or command definition.

scale

Scale a service up or down and change the number of running tasks.

Usage

For detailed information about the available actions, arguments and options, run:

$ ecs deploy --help
$ ecs scale --help

Examples

All examples assume, that authentication has already been configured.

Simple Redeploy

To redeploy a service without any modifications, but pulling the most recent image versions, run the follwing command. This will duplicate the current task definition and cause the service to redeploy all running tasks.:

$ ecs deploy my-cluster my-service

Deploy a new tag

To change the tag for all images in all containers in the task definition, run the following command:

$ ecs deploy my-cluster my-service -t 1.2.3

Deploy a new image

To change the image of a specific container, run the following command:

$ ecs deploy my-cluster my-service --image webserver nginx:latest

This will modify the webserver container only and change its image to “nginx:latest”.

Deploy several new image

The -i or –image option can also be passed several times:

$ ecs deploy my-cluster my-service -i webserver nginx:1.9 -i application django:latest

This will change the webserver’s container image to “nginx:1.9” and the application’s image to “django:latest”.

Set an environment variable

To add a new or adjust an existing environment variable of a specific container, run the following command:

$ ecs deploy my-cluster my-service -e webserver SOME_VARIABLE SOME_VALUE

This will modify the webserver container definition and add or overwrite the environment variable SOME_VARIABLE with the value “SOME_VALUE”. This way you can add new or adjust already existing environment variables.

Adjust multiple environment variables

You can add or change multiple environment variables at once, by adding the -e (or –env) options several times:

$ ecs deploy my-cluster my-service -e webserver SOME_VARIABLE SOME_VALUE -e webserver OTHER_VARIABLE OTHER_VALUE -e app APP_VARIABLE APP_VALUE

This will modify the definition of two containers. The webserver’s environment variable SOME_VARIABLE will be set to “SOME_VALUE” and the variable OTHER_VARIABLE to “OTHER_VALUE”. The app’s environment variable APP_VARIABLE will be set to “APP_VALUE”.

Modify a command

To change the command of a specific container, run the following command:

$ ecs deploy my-cluster my-service --command webserver "nginx"

This will modify the webserver container and change its command to “nginx”.

Scale a service

To change the number of running tasks and scale a service up and down, run this command:

$ ecs scale my-cluster my-service 4

Metadata

Release files for ecs-deploy 0.3.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for ecs-deploy 0.3.0
File Size Uploaded Provenance Actions
ecs-deploy-0.3.0.tar.gz 13.2 kB Without provenance Details for ecs-deploy-0.3.0.tar.gz

Release files / ecs-deploy-0.3.0.tar.gz

Download URL ecs-deploy-0.3.0.tar.gz
Size 13.2 kB
Tags Source
SHA-256 checksum
How to use checksums
48e06f0a434da754d27affe19093b5d8965eeda71ada3c9df09454158bffd266
BLAKE2b-256 checksum
How to use checksums
a5d62581a03e4bf88be1593f347132f7229a8260f275038fec5fd6f502011a27
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Security for ecs-deploy 0.3.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.3.0 This release

1 release file No provenance

0.2.0

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page