We have auto-scaling group behind an Application load balancer which launches instances if the avg. CPU Utilization goes beyond 70%.
We have created a base AMI for the auto-scaling group.
But the problem is that our website updates almost on a regular or weekly basis so what we can configure to allow AWS code-deploy to automatically deploy our latest revision from github on those instances created via auto-scaling group?
If any more information is required please let me know.
Code Deploy fully supports Auto Scaling.
Here are the steps to integrate these two services: Integrating CodeDeploy with Amazon EC2 Auto Scaling
Hope that helps :)
You just have to point the deployment group to Auto-scaling group.
It is a horrifying implicit magic.
However, to make it work you need to set
Deployment type In-place
, or you will get a new auto scaling group instead. And it mean that you still need 2 instances at least.Initiating event
on each 'Deployment' can tell you more. If your autoScaling group would start a new instance, you will have a new deployment in yourCodeDeploy
and theInitiating event
would sayautoScaling
, when normally it would sayuser
.Also look into
Auto Scaling Group Lifecycle Hook
. TheCode deploy
creates the hook and name it like soand it somehow knows the
Revision
. Documentetion.I could not trace of how
SQS Notification
fromAuto Scaling Group Lifecycle Hook
connected to exactCodeDeploy Deployment group
and that is why I call itmagic
.