Create a New Elastic Beanstalk Environment for my-app Project

Create a New Elastic Beanstalk Environment

Prev Question Next Question

Question

You need to create a new Elastic Beanstalk environment for the following my-app project.

Answers

Explanations

Click on the arrows to vote for the correct answer

A. B. C. D.

Correct Answer - B.

For a saved configuration, you can use eb create --cfg savedconfig to apply it.

It will override existing settings in the .ebextensions folder.

For the precedence of different configuration options, please check https://docs.aws.amazon.com/elasticbeanstalk/latest/dg/command-options.html#configuration-options-precedence.

Option A is incorrect: Because the files under the .ebextensions folder should not be deleted as a saved configuration can override the .ebextensions configurations.

Option B is CORRECT: Because the EB CLI eb create --cfg savedconfig applies the saved configuration for the new environment.

Please check https://docs.aws.amazon.com/elasticbeanstalk/latest/dg/eb3-create.html.

Option C is incorrect: Because the .ebextensions files do not override the saved configuration.

The .ebextensions folder should not be deleted.

Option D is incorrect: Because it is not required to modify the environmentvariables.config file.

Similar to option.

C.

Sure, I can explain the options to create a new Elastic Beanstalk environment for the my-app project and their implications.

Option A: Delete the file environmentvariables.config as it is not required. Use EB CLI eb deploy to create a new Elastic Beanstalk environment.

This option suggests deleting the environmentvariables.config file and then using the EB CLI eb deploy command to create a new Elastic Beanstalk environment. Deleting the environmentvariables.config file can be risky as it may contain important configuration settings for the application. The eb deploy command deploys the application code to an existing Elastic Beanstalk environment, so it is not suitable for creating a new environment. Therefore, this option is not the correct answer.

Option B: Use the EB CLI eb create --cfg savedconfig to apply the saved configuration for the new environment.

This option suggests using the EB CLI eb create command with the --cfg option to apply a saved configuration for the new environment. This option is a correct answer because the saved configuration can contain important settings such as environment variables, instance type, and scaling options. The saved configuration can be created using the EB CLI or the Elastic Beanstalk console. Using the eb create command with the --cfg option will create a new environment with the settings from the saved configuration.

Option C: Remove the .ebextensions folder as it will override the saved configuration. Use AWS CLI aws elasticbeanstalk create-environment --application-name my-app --environment-name my-env --template-name savedconfig to create the new environment.

This option suggests removing the .ebextensions folder, which can contain configuration files for the Elastic Beanstalk environment. Removing this folder can cause important configuration settings to be lost. The aws elasticbeanstalk create-environment command can create a new environment with the settings from a saved configuration template. However, this option is not the correct answer as it suggests removing the .ebextensions folder, which can cause loss of important settings.

Option D: Modify the environmentvariables.config file to use the same settings as the saved configuration. Use the EB CLI eb create --cfg savedconfig.cfg.yml to create a new Elastic Beanstalk environment.

This option suggests modifying the environmentvariables.config file to match the settings from the saved configuration and then using the EB CLI eb create command with the --cfg option to create a new environment. This option is not the correct answer as modifying the environmentvariables.config file may not be sufficient to match all the settings from the saved configuration. It is better to use the saved configuration directly with the --cfg option.

Therefore, option B is the correct answer as it suggests using the saved configuration directly to create a new Elastic Beanstalk environment.