AWS CodeDeploy runs before user data script automatically scales

I am trying to set up an auto-scaling group in conjunction with CodeDeploy. Everything works fine, except for the fact that when creating a new instance, CodeDeploy is launched before the user script data (defined in the launch configuration) is completed.

The default value for this user data script downloads and installs the code deployment agent, and I expanded it by installing several Windows functions, the IIS rewriter, and msdeploy.

In my appspec.yml, I use the AfterInstall hook to deploy my IIS website, and this obviously fails when msdeploy is not installed (yet).

How am I mistaken about this, or is there a way to get CodeDeploy to wait for the completion of the user data script?

+4
source share
1 answer

Unfortunately, there was nothing for CodeDeploy to learn anything more than the instance loaded its OS. It’s good that CodeDeploy gives the host agent 1 hour to start polling for auto-deploy commands. The simplest is to install the host agent after installing all the necessary dependencies. An automatic deployment will be created, but cannot continue until the host agent is started.

+3
source

Source: https://habr.com/ru/post/1613368/


All Articles