ecsy
ecsy copied to clipboard
Run deployment via CloudFormation
As an experiment, I am going to see what the deploy time is like for handling deploys by CloudFormation updates:
@pda Ability to perform CloudFormation Change Sets / Stack Update including for the Service / Task Definition without the deployed docker image tag version getting out of sync with CI deploys.
Seems like the best way to accomplish the above and move code out of ecsy.
I've done this a few times; it seems to work pretty well and doesn't add much time overhead. It works for service changes (e.g. just a new docker image version) as well as cluster changes (e.g. new AMI; it performs a rolling restart across the cluster with zero downtime* for the services on that cluster).
* Some extra moving parts might be required to make it seamless: https://aws.amazon.com/blogs/compute/how-to-automate-container-instance-draining-in-amazon-ecs/
But it does add indirection to the deploy/cutover, perhaps making it harder to track progress; perhaps a combination of polling CloudFormation events and and ECS APIs would allow progress/status tracking.
I'm still not sure if CloudFormation is too heavy/indirect for routine code deploys to ECS, but it does seem the simplest way to avoid duplication of the task definition (assuming one is using CloudFormation for provisioning the service in the first place).
The other option would be to do this via the API still, but reference the taskDefinition from the Cloudformation template, and then after the API update the Cloudformation to match (should be a no-op)