Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/labd/ecs-deplojo
Deployment tool for Amazon ECS
https://github.com/labd/ecs-deplojo
amazon-web-services aws ecs
Last synced: 3 months ago
JSON representation
Deployment tool for Amazon ECS
- Host: GitHub
- URL: https://github.com/labd/ecs-deplojo
- Owner: labd
- License: mit
- Created: 2015-10-29T15:37:24.000Z (about 9 years ago)
- Default Branch: main
- Last Pushed: 2023-04-28T09:39:06.000Z (over 1 year ago)
- Last Synced: 2024-09-17T11:07:32.869Z (4 months ago)
- Topics: amazon-web-services, aws, ecs
- Language: Python
- Size: 106 KB
- Stars: 19
- Watchers: 6
- Forks: 6
- Open Issues: 5
-
Metadata Files:
- Readme: README.rst
- License: LICENSE
Awesome Lists containing this project
README
ecs-deplojo
===========Deployment tool for Amazon ECS.
Installation
------------`pip install ecs-deplojo`
.. start-no-pypi
Status
------.. image:: https://readthedocs.org/projects/ecs-deplojo/badge/?version=latest
:target: https://readthedocs.org/projects/ecs-deplojo/.. image:: https://github.com/labd/ecs-deplojo/workflows/Python%20Tests/badge.svg
:target: https://github.com/labd/ecs-deplojo/actions?query=workflow%3A%22Python+Tests%22.. image:: http://codecov.io/github/LabD/ecs-deplojo/coverage.svg?branch=master
:target: http://codecov.io/github/LabD/ecs-deplojo?branch=master.. image:: https://img.shields.io/pypi/v/ecs-deplojo.svg
:target: https://pypi.python.org/pypi/ecs-deplojo/.. end-no-pypi
Usage
-----.. code-block:: console
Usage: ecs-deplojo [OPTIONS]
Options:
--config FILENAME [required]
--var VAR
--dry-run
--output-path PATH
--role-arn
--help Show this message and exit.Example configuration
---------------------.. code-block:: yaml
---
cluster_name: exampleenvironment:
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.jsonservices:
web:
task_definition: webbefore_deploy:
- task_definition: manage
container: uwsgi
command: manage.py migrate --noinputafter_deploy:
- task_definition: manage
container: uwsgi
command: manage.py clearsessionsUsing SSM secrets
-----------------**Warning secrets will become visible in the container's environent, use with caution**
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 AWSAt 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:**
.. code-block:: yaml
--
cluster_name: exampleenvironment:
NORMAL_ENV_VAR: value_of_variablesecrets:
DATABASE_URL: /path/to/secret/DATABASE_URLtask_definitions:
web:
execution_role_arn: arn:aws:iam:::role/execution_role_name
template: task_definitions/web.jsonservices:
web:
task_definition: webWhen the container is started the secrets are available as environment variables and
hidden in the AWS ECS console, this is not recommended in production.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
------------------.. code-block:: console
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)