A developer is preparing a Java application package for deployment to an AWS Elastic Beanstalk environment. The application requires a custom system-level utility, `htop`, to be installed on the underlying Amazon EC2 instances. Additionally, the application requires an environment variable named `DB_HOST` to be accessible at runtime. Which two actions should the developer take to satisfy these requirements?
- Create a configuration file ending with `.config` inside a directory named `.ebextensions` at the root of the application source bundle, and use the `packages` section to define the `htop` installation.Cevap
- Configure the `DB_HOST` environment variable in the Environment Properties section of the Elastic Beanstalk environment configuration.Cevap
- CCreate a configuration file ending with `.config` inside a directory named `ebextensions` (without a leading dot) at the root of the application source bundle.
- DDefine the `DB_HOST` environment variable inside a `buildspec.yml` file placed at the root of the application source bundle.
- EPlace the `.ebextensions` directory inside the application's source code subfolder, such as `src/main/resources`, to compile it into the application's JAR/WAR archive.
Cevap
Create a configuration file ending with `.config` in a folder named `.ebextensions` at the root of the application source bundle to install the package, and configure the environment variable in the Environment Properties section under the Elastic Beanstalk environment configuration.
The correct solution involves leveraging `.ebextensions` at the root of the source bundle to configure package dependencies and using the Environment Properties configuration setting to handle variable values, satisfying both host-level and application-level requirements.
Adım Adım Çözüm
Anahtar Kavram
AWS Elastic Beanstalk instance customization via `.ebextensions` configuration files and runtime environment variable configuration.