Skip to content
muratyPublic

About

AWS ECS deployment CLI

Topics

Resources

Stars

8 stars

Watchers

2 watching

Forks

Latest commit

 

History

139 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

aeropress

aeropress is a CLI program for deploying Docker images to AWS ECS. It receives a folder path that includes ECS task and service definitions and then does the jobs respectively;

  • Register ECS task definitions
  • Create Cloudwatch metrics for scaling policies
  • Create or update scaling policies for ECS services
  • Create or update alarms on Cloudwatch
  • Create or update ECS services

Installation

aeropress requires Python 3.10 or newer.

uv tool install aeropress

Development

uv sync                # create .venv with aeropress and the dev tools
uv run ruff check      # lint
uv run ty check        # type check
uv build               # build sdist and wheel into dist/
uv publish             # upload dist/ to PyPI

Usage

$ aeropress --help
usage: aeropress [-h] [--logging-level {debug,info,warning,error}] [--version] {deploy,clean,register} ...

aeropress AWS ECS deployment helper

positional arguments:
  {deploy,clean,register}
                        sub-command help
    deploy              Deploy docker image to ECS.
    clean               Clean commands for stale entities on AWS.
    register            Register tasks on ECS.

options:
  -h, --help            show this help message and exit
  --logging-level {debug,info,warning,error}
                        Print debug logs
  --version             show program's version number and exit

Run aeropress <command> --help for the options of each command.

Example

You must have defined an ECS cluster first. Then, you can define ECS tasks and services in yaml files under a folder (see example/foo.yaml) and run aeropress with required arguments.

Deploy an image to a service; registers its task definition, then updates the service:

aeropress deploy --path example --image-url 'registry.hub.docker.com/library/python' --service-names service-foo

Register a task definition without touching any service:

aeropress register --path example --task-definition task-foo --image-url 'registry.hub.docker.com/library/python'

Deregister task definition revisions that no service uses:

aeropress clean --stale-tasks

Log retention

aeropress creates the CloudWatch log groups named in logConfiguration.options.awslogs-group and sets their retention on every deploy or register. It is 7 days unless the task sets logRetentionDays:

task:
  family: task-foo
  logRetentionDays: 30

Only the values CloudWatch accepts are allowed (1, 3, 5, 7, 14, 30, 60, 90, ...); see https://docs.aws.amazon.com/AmazonCloudWatchLogs/latest/APIReference/API_PutRetentionPolicy.html

About

AWS ECS deployment CLI

Topics

Resources

Stars

8 stars

Watchers

2 watching

Forks

Releases

Packages

Used by

Contributors

Languages