Soru

Zorluk: KolayAWS Elastic Beanstalk

A developer is preparing a deployment package for a Python application to be deployed on AWS Elastic Beanstalk. The application requires a Linux system package to be installed on the hosting EC2 instances during deployment, and a custom database connection string environment variable to be configured. Which two configurations should the developer include in the application source bundle to meet these requirements?

  1. Create a folder named `.ebextensions` at the root of the source bundle and place a file ending with `.config` inside it to define the required Linux package.Cevap
  2. Define the database connection string environment variable under the `aws:elasticbeanstalk:application:environment` namespace in a `.config` file within the `.ebextensions` folder.Cevap
  3. C
    Create a folder named `ebextensions` (without a leading period) at the root of the source bundle and place the configuration files there.
  4. D
    Create a folder named `.elasticbeanstalk` at the root of the source bundle and place the configuration files there.
  5. E
    Create an `appspec.yml` file at the root of the source bundle and define the package installation and environment variables under the lifecycle hooks.

Cevap

Create a folder named `.ebextensions` at the root of the source bundle and place a file ending with `.config` inside it to define the required Linux package; and define the database connection string environment variable under the `aws:elasticbeanstalk:application:environment` namespace in a `.config` file within the `.ebextensions` folder.
The correct configurations involve creating a `.ebextensions` folder at the root of the source bundle containing `.config` files. System packages are installed using the `packages` key, and environment variables are set using the `aws:elasticbeanstalk:application:environment` namespace within these files.

Adım Adım Çözüm

1
Identify the mechanism for custom environment configuration and package installation in AWS Elastic Beanstalk.
AWS Elastic Beanstalk uses configuration files under the `.ebextensions` directory at the root of the source bundle.
This is the native mechanism for customization of the platform and application environment during deployment.
2
Determine the correct directory naming and location rules.
The folder must be named `.ebextensions` with a leading dot and must be at the root of the zip source bundle.
Elastic Beanstalk checks this specific path; missing the dot (e.g. `ebextensions`) or using `.elasticbeanstalk` (reserved for local EB CLI) will cause configurations to be ignored.
3
Identify the standard namespace for environment variables inside the configuration files.
The namespace to define environment properties is `aws:elasticbeanstalk:application:environment`.
Specifying variables within this namespace injects them as environment variables accessible to the application code.

Anahtar Kavram

AWS Elastic Beanstalk environment customization using .ebextensions configuration files
Bu soruyu puanla