Reputation: 1
We generally use BlueGreen & Rolling deployment strategy,
for docker containers in ECS container instances, to get deployed & updated.
Ansible ECS modules allow implement such deployment strategies with below modules:
https://docs.ansible.com/ansible/latest/modules/ecs_taskdefinition_module.html
https://docs.ansible.com/ansible/latest/modules/ecs_task_module.html
https://docs.ansible.com/ansible/latest/modules/ecs_service_module.html
Does AWS CDK provide such constructs for implementing deployment strategies?
Upvotes: 3
Views: 2400
Reputation: 514
Check this NPM plugin which helps with blue-green deployment using CDK.
https://www.npmjs.com/package/@cloudcomponents/cdk-blue-green-container-deployment
Upvotes: 2
Reputation: 514
Blue green deployments are supported in cloud formation now .
Don’t think CDK implementation is done yet .
Upvotes: 1
Reputation: 735
CDK supports higher level constructs for ECS called "ECS patterns". One of them is ApplicationLoadBalancedFargateService which allows you to define an ECS Fargate service behind an Application Load Balancer. Rolling update is supported out of the box in this case. You simply run cdk deploy
with a newer Docker image and ECS will take care of the deployment. It will:
If your new task does not start or is not healthy, ECS will keep running the original task.
Regarding Blue-Green deployment I think it's yet to be supported in CloudFormation. Once that's done, it can be implemented in CDK. If you can live without BlueGreen as IaC, you can define your CodeDeploy manually.
Upvotes: 3