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?
- Place a YAML configuration file ending with a `.config` extension inside a folder named `.ebextensions` at the root of the application source bundle.Answer
- BCreate a folder named `ebextensions` without a leading period at the root of the application source bundle, and place a JSON configuration file inside it.
- CCreate an `appspec.yml` file at the root of the application source bundle to define the environment settings and Auto Scaling parameters.
- DSave 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
Key Concept
AWS Elastic Beanstalk Configuration Files (.ebextensions)