Deploying to Amazon ECS
The following macros are not currently supported in the header:
  • unmigrated-wiki-markup

Documentation for Tasks for AWS 2.9 – other releases are available in the Tasks for AWS Documentation Directory.
View

Unknown macro: {spacejump}

or visit the current documentation home.

Deploying to Amazon ECS

Components

The deployment of Docker containers to the Amazon EC2 Container Service (ECS) involves several major components as follows:

  • Cluster – a logical grouping of container instances that you can place tasks on (see the next three), see Scheduling Amazon ECS Tasks

  • Task Definition – a description of an application that contains one or more container definitions, see Amazon ECS Task Definitions

  • Taskan instantiation of a task definition that is running on a container instance, see Amazon ECS Tasks 

  • Servicea scheduler that ensures that the specified number of tasks are constantly running and rescheduled on failure, and optionally registered against an Elastic Load Balancing load balancer, see Amazon ECS Services

Workflow

The typical deployment workflow comprises two optional and one mandatory phases:

(Optional) Create an ECS Cluster and ECS Container Instances

An ECS cluster is the target environment to deploy Docker containers to. If you have explored ECS already, you might have a Default cluster available already in your AWS account. If you do not have one ore more clusters provisioned already, or if you want to isolate the additional containers in a separate cluster, you might need to create one first, which can be achieved in various ways, for example:

(Optional) Build and push a Docker image to a Docker registry

Your are going to deploy a Docker container based on a Docker image. This image might exist already, or you might want to create it during the build. The latter can be achieved with the Docker task in Bamboo (available as of Bamboo 5.8), which allows you to:

Deploy a Docker image to ECS

This is the main and mandatory activity for using Amazon ECS. The three main options for deploying Docker containers to ECS are described in Scheduling Amazon ECS Tasks and available within Tasks for AWS accordingly:

Alternative workflow via CloudFormation

As an alternative to using the Amazon ECS tasks built into Tasks for AWS, it is also possible to provision most ECS components directly via the AWS CloudFormation Stack task and the corresponding CloudFormation resource types:

A typical workflow based on CloudFormation might look as follows:

  1. (optional) create/update the CloudFormation stack that provisions the ECS cluster and ECS container instances – see the Create Stack action of the AWS CloudFormation Stack task

    1. You can use the Update stack, if it already exists option to reuse the same Bamboo job for both actions

  2. create/update the CloudFormation stack that provisions the ECS task definition and service – see the Create Stack action of the AWS CloudFormation Stack task

    1. You can use the Update stack, if it already exists option to reuse the same Bamboo job for both actions

Frequently Asked Questions (FAQ)