Step Templates collection to deploy docker images to AWS ECS Cluster using Octopus Deploy
Docker hub templates:
- Templates make the assumption that the task definition is composed of a single container image, for task definitions that are composed of multiple container images the step were the new task definition revision is created should be customized.
- The templates are still not integrated with AWS Application Load Balancers (to check for deployment status)
Take a look to the ecr templates they support task definitions with multiple containers and application load balancers.
- This templates depends on a Linux Agent .
- bash
- jq
- docker
- aws cli
- An iam role (see below)
ECR
- aws-ecs-deploy-template.sh
- Variables
- Region (AWS Region)
- Cluster (ECS Cluster Name)
- Service (ECS Cluster Service)
- TaskDefinition (Task Definition family)
- TaskDefinitionContainer (The name of the container inside the task definition that will be deployed)
- Can be empty for task definitions that only have one container.
- EcrRepositoryUrl
- EcrRepositoryName
- DockerBuildTag (your custom Build tag text to identify the container)
- Variables
- dockerize-artifacts.sh
- Variables
- Region (AWS Region)
- EcrRepositoryUrl
- EcrRepositoryName
- DockerBuildTag (your custom Build tag text to identify the container)
- Variables
Docker Hub
- aws-ecs-deploy-template.sh
- Variables
- Region (AWS Region)
- Cluster (ECS Cluster Name)
- Service (ECS Cluster Service)
- TaskDefinition (Task Definition family)
- DockerRepoUser
- DockerRepoPassword
- DockerRepo
- DockerBuildTag (your custom Build tag text to identify the container)
- Variables
- dockerize-artifacts.sh
- Variables
- DockerRepoEmail
- DockerRepoUser
- DockerRepoPassword
- DockerRepo
- DockerBuildTag (your custom Build tag text to identify the container)
- Variables
- IAM Role
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "ELBPermisions",
"Effect": "Allow",
"Action": [
"elasticloadbalancing:DeregisterInstancesFromLoadBalancer",
"elasticloadbalancing:DescribeTargetHealth",
"elasticloadbalancing:DescribeInstanceHealth"
],
"Resource": [
"*"
]
},
{
"Sid": "ECSPermisions",
"Effect": "Allow",
"Action": [
"ecs:DescribeServices",
"ecs:DescribeTaskDefinition",
"ecs:RegisterTaskDefinition",
"ecs:UpdateService",
"ecs:ListTasks",
"ecs:StopTask",
"ecr:GetAuthorizationToken",
"iam:PassRole"
],
"Resource": [
"*"
]
}
]
}