Scripts added to deregister admin app from ELB on deploy

- Application Stop state will deregister
- Application Start state re-registers

Ensures that the App instance is not receiving traffic before stopping the app as part of a code deploy

These scripts are from :

https://blogs.aws.amazon.com/application-management/post/Tx39X8HM93NXU47/Use-AWS-CodeDeploy-to-Deploy-to-Amazon-EC2-Instances-Behind-an-Elastic-Load-Bala

Adapted to remove notion of Autoscaling groups (which we don't use) and to use a named ELB, allows common file to be common and start/stop to be changed.
This commit is contained in:
Martyn Inglis
2016-05-18 13:08:51 +01:00
parent 97b268182b
commit 44b0bd3092
4 changed files with 498 additions and 2 deletions

View File

@@ -14,14 +14,24 @@ hooks:
runas: root
timeout: 300
ApplicationStart:
-
-
location: scripts/aws_start_app.sh
runas: root
timeout: 300
ApplicationStop:
-
location: scripts/register_with_elb.sh
runas: root
timeout: 300
ApplicationStop:
-
location: scripts/deregister_from_elb.sh
runas: root
timeout: 300
-
location: scripts/aws_stop_app.sh
runas: root
timeout: 300
os: linux
version: 0.0