This wercker step allows to deploy Docker containers with AWS ECS service or run a task outside of a service.
Please read the AWS ECS documentation and API before using this step.
The step is written in Python 2.7 and use Pip and Boto3 module.
To deploy an application with AWS ECS, the Wercker step follow this steps:
There is two different flows depending if the Wercker step is running in "service mode" or in "task only mode".
If service-name
is provided in the configuration, the service mode is used.
Step Configuring AWS
This initial step consists on configuring AWS.
The following configuration allows to setup this step :
key
(required): AWS Access Key IDsecret
(required): AWS Secret Access Keyregion
(optional): Default region name
This step register a new task definition for the service.
The following configuration allows to setup this step :
task-definition-name
(required): The name of the task definitiontask-definition-file
(required): The file containing the task definition
Step Checking ECS Cluster
This step check a previously created ECS cluster exists.
The following configuration allows to setup this step :
cluster-name
(optional): The name of the cluster to deploy the service
Step Checking ECS Service (Skipped in task only mode)
This step check a previously created ECS service exists. The service MUST be created before using this step.
The following configuration allows to setup this step :
service-name
(optional): The name of the service to deploy
Step Update ECS Service
This step update the service with the new revision.
Step Run task
This step run a task on a single node and wait for its completion. The step fail if the task can't be run or if its command exit code is different from 0.
The following example deploy an hello
service on ECS :
deploy:
steps:
- ton-katsu/aws-ecs:
key: aws_access_key_id
secret: aws_access_secret_id
task-definition-name: hello-migrate-db
task-definition-file: /app/hello-migrate-db-task-definition.json
- ton-katsu/aws-ecs:
key: aws_access_key_id
secret: aws_access_secret_id
cluster-name: staging
task-definition-name: hello-migrate-db
task-definition-file: /app/hello-migrate-db-task-definition.json
- ton-katsu/aws-ecs:
key: aws_access_key_id
secret: aws_access_secret_id
cluster-name: staging
service-name: hello
task-definition-name: hello
task-definition-file: /app/hello-task-definition.json
task-definition-volumes-file: /app/hello-task-definition-volumes.json