A developer is migrating a Node.js web application to an AWS Elastic Beanstalk environment running on an Amazon Linux 2023 platform. The application requires two specific configurations:
1. It must execute a custom shell script named `configure-auth.sh` to download and configure an SSL certificate *after* the application files are extracted and staged on the host, but *before* the application process is launched.
2. It must configure a system environment variable named `DB_MAX_CONN` with a value of `100` across all instances.
Which two actions should the developer take to successfully deploy these customizations? (Select TWO.)
- Place the script `configure-auth.sh` in the `.platform/hooks/predeploy/` directory of the application source bundle and ensure it has execute permissions.Answer
- Create a configuration file named `db.config` containing the option settings for the `aws:elasticbeanstalk:application:environment` namespace and place it in the `.ebextensions/` directory at the root of the source bundle.Answer
- CCreate a configuration file named `db.config` containing the environment settings and place it in a folder named `ebextensions/` (without the leading dot) at the root of the source bundle.
- DPlace the script `configure-auth.sh` in the `.ebextensions/hooks/predeploy/` directory of the application source bundle.
- EDefine the `DB_MAX_CONN` environment variable in the application's package manager configuration (such as `package.json` for Node.js) under a custom Elastic Beanstalk section.
Answer
The developer must place the script in the `.platform/hooks/predeploy/` directory with execution permissions, and place the environment variable configuration file in the `.ebextensions/` directory.
The correct options state that the hook script must be located in `.platform/hooks/predeploy/` with execution permissions, and the configuration file for the environment variable must be located in `.ebextensions/` at the root of the source bundle. Under Amazon Linux 2 and Amazon Linux 2023 platforms, Elastic Beanstalk uses `.platform/hooks/predeploy/` to run custom scripts after the source bundle has been extracted and staged but before the application process is executed. The `.ebextensions/` directory containing configuration files is the standard mechanism to set environment variables through the `aws:elasticbeanstalk:application:environment` namespace.
Step-by-Step Solution
Key Concept
AWS Elastic Beanstalk Amazon Linux 2/2023 Platform Customization via .platform and .ebextensions
Estimated Time:3m 0s