Using Elastic Beanstalk with Amazon Linux 2, I'm trying to have the same hook executed for a deployment (code deployment) and a configuration deployment, without having to duplicate my code in two different spots.
According to AWS docs eb will run hooks in .platform/hooks/prebuild
within a deployment intial steps, but will run hooks in .platform/confighooks/prebuild
in case of a configuration deployment.
My files look like this.
.platform
├── hooks
│ └── prebuild
│ ├── 00_hookname.sh
│ ├── 01_hookname.sh
│ └── 99_basic_auth.sh
└── httpd
└── conf.d
└── elasticbeanstalk
├── directory.conf
├── hardening.conf
└── headers.conf
I'm trying to find a way to have 99_basic_auth.sh to run for a deployment and for a configuration deployment without having to duplicate that code.
Is there any way I can achieve that?
Cheers!