Question

Difficulty: MediumAWS Elastic Beanstalk

A developer needs to configure autoscaling thresholds and environment properties for a web application deployed via AWS Elastic Beanstalk. To ensure consistency across development, staging, and production environments, the developer wants these configurations to be version-controlled in the Git repository alongside the application source code. Which of the following approaches should the developer use to satisfy these requirements?

  1. Place a YAML configuration file ending with a `.config` extension inside a folder named `.ebextensions` at the root of the application source bundle.Answer
  2. B
    Create a folder named `ebextensions` without a leading period at the root of the application source bundle, and place a JSON configuration file inside it.
  3. C
    Create an `appspec.yml` file at the root of the application source bundle to define the environment settings and Auto Scaling parameters.
  4. D
    Save the environment configurations through the Elastic Beanstalk console and upload the exported JSON configuration file to the root of a central Amazon S3 bucket.

Answer

Place a YAML configuration file ending with a `.config` extension inside a folder named `.ebextensions` at the root of the application source bundle.
Placing configuration files with a `.config` extension inside the `.ebextensions` folder at the root of the application source bundle is the standard way to package environment configurations with the application code. This ensures they are version-controlled in the repository and automatically applied to the Elastic Beanstalk environment during deployment.

Step-by-Step Solution

1
Determine the mechanism for packaging configurations with Elastic Beanstalk source code.
Identify that Elastic Beanstalk uses configuration files inside the source bundle to customize the environment.
This ensures the configuration is tracked in Git alongside the code.
2
Identify the correct directory name and file extension required by Elastic Beanstalk.
The directory must be named `.ebextensions` (with a leading dot) at the root of the project, and files must end with `.config`.
Elastic Beanstalk specifically scans this folder path and suffix during application deployment.

Key Concept

AWS Elastic Beanstalk Configuration Files (.ebextensions)
Rate this question