aws-samples / aws-samples/aws-codedeploy-samples

How to recover from failed deploy when using ASG lifecycle scripts?

Open
#42 4 comments 1 reaction 0 assignees View on GitHub
bug
Dominant language
Shell
Stars
639
Forks
778
PR merge metrics
No merged PRs in 30d

Description

We just started using CodeDeploy with ASG and ELB, and we achieve zero downtime when we use `register_with_elb.sh` and `deregister_from_elb.sh`. Today I simulated a situation where a deploy step before `deregister_from_elb.sh` fails. In that case, the server instance in ASG stays in Standby mode and the capacity of ASG is decreased by one because `deregister_from_elb.sh` is never executed.

Currently, I have to manually increase the ASG capacity back to normal and move the server instance out of Standby. This isn't acceptable. Is there a way to do proper cleanup automatically after a failed deploy?

The only way that came to my mind is to add error handling logic to every deploy script I run between `register_with_elb.sh` and `deregister_from_elb.sh` scripts.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.