0

With reference to the docs,

Consider I have .ebextension/03_hooks.config which has

commands:
  create_app_deploy_post_dir:
    command: "mkdir -p /opt/elasticbeanstalk/hooks/appdeploy/post"
    ignoreErrors: true

files:
  "/opt/elasticbeanstalk/hooks/appdeploy/post/99-post-deploy-test.sh":
        mode: "000755"
        owner: root
        group: root
        content: |
          #!/usr/bin/env bash

          eventHelper.py --msg "Successfully executing post deployment hook." --severity INFO

The file is not created and executed during the very first deploy, that is when an EC2 instance is added during env create or auto scaling. The new instance is almost useless and become useful only on the next force redeploying the app by eb deploy or deploy zip from Application Versions.

Observation

  1. Checked if the files are created in the newly added EC2 instance, they are not.
  2. The commands given in the commands directive also not executed as I checked the eb logs.
  3. Which gives me the feel like these two directives are ignored on first deploy in a newly added instance.

Real use case: I have hook scripts to write and start/restart the nginx and uwsgi on appdeploy enack and post. So without them executing on the new instances, there will be intermittent 502 returned till the next deployment.

Babu
  • 151
  • 1
  • 5

0 Answers0