docker-ecs-utils/ecs-cluster-application.yml
Continuous Deployment using Stacker:
- name: ECS-Dev-App-Example
template_path: ecs-cluster-application.yml
region: ap-southeast-2
profile: nonprod
requires:
- ECS-Dev
variables:
Name: Example
Environment: Dev
ClusterName: Dev
HostedZoneName: dev-apps.amaysim.net.
LBType: ALB
Scheme: External
SSLCertificateARN: arn:aws:acm:ap-southeast-2:999999999999:certificate/4013c1bc-a532-4fcc-9f90-123456789876 # *.dev-apps.amaysim.net
Subnets: subnet-12345678,subnet-22345678,subnet-3456789e # Dev Public x
VpcId: vpc-abc234ad
deploy
, cutover
and autocleanup
targets to Makefileamaysim/ecs-utils
to docker-compose.yml
{
"containerDefinitions": [
{
"essential": true,
"image": "123456789987.dkr.ecr.ap-southeast-2.amazonaws.com/devops/ok:${BUILD_VERSION}",
"name": "${ECS_APP_NAME}",
"linuxParameters": {
"initProcessEnabled": true
},
"portMappings": [
{
"containerPort": 8888
}
],
"logConfiguration": {
"logDriver": "awslogs",
"options": {
"awslogs-group": "ecs-${ECS_APP_NAME}-${ENV}",
"awslogs-region": "ap-southeast-2",
"awslogs-stream-prefix": "${BUILD_VERSION}"
}
}
}
],
"family": "${ECS_APP_NAME}-${ENV}",
"volumes": [],
"memory": "128",
"cpu": "128"
}
---
lb_health_check: /app/healthcheck
lb_health_check_grace_period: 30
lb_deregistration_delay: 60
autoscaling: Enable
autoscaling_target: 60 # what level of CPU utilisation to maintain
autoscaling_min_size: 3
autoscaling_max_size: 20
deploy: $(ENV_RM_REQUIRED) $(DOTENV_TARGET) $(ASSUME_REQUIRED)
docker-compose run --rm ecs make -f /scripts/Makefile deploy
cutover: $(ENV_RM_REQUIRED) $(DOTENV_TARGET) $(ASSUME_REQUIRED)
docker-compose run --rm ecs make -f /scripts/Makefile cutover
autocleanup: $(ENV_RM_REQUIRED) $(DOTENV_TARGET) $(ASSUME_REQUIRED)
docker-compose run --rm ecs make -f /scripts/Makefile autocleanup
ENV=Dev
REALM=NonProd
ECS_APP_NAME=Example
ECS_CLUSTER_NAME=Dev
BUILD_VERSION=10-b4cce22
AWS_DEFAULT_REGION=ap-southeast-2
AWS_HOSTED_ZONE=www-dev.amaysim.com.au
BASE_PATH=/551f7c62858899445e42d904170f56ca
Questions?