You were assigned a task to migrate an on-premises application to the AWS Elastic Beanstalk environment.
The operating system is Amazon Linux and package managers yum and RubyGems are required in order to install all necessary packages for the application.
You have created config files in .ebextensions.
In the config files, you added a Package section to install software packages.
Which statement is correct for the Package section in the configuration file?
Click on the arrows to vote for the correct answer
A. B. C. D.Correct Answer -A.
Refer to.
https://docs.aws.amazon.com/elasticbeanstalk/latest/dg/customize-containers-ec2.html#linux-packageson how to use the Packages section for .ebextensions configuration files.
Option A is CORRECT: The order within a package manager isn't guaranteed.
Take the below snippet for example:
packages:
yum:
application1: []
application2: []
Application2 may be installed first.
Option B is incorrect: Because package managers including yum, RubyGems, python, and rpm are supported.
Option C is incorrect: Because software versions can be specified such as below:
packages:
RubyGems:
chef: '0.10.2'
Option D is incorrect: Because one config file can use several package managers.
There is no need to use two separate files.
The correct answer is B.
Explanation:
When using Elastic Beanstalk to deploy an application, the AWS Elastic Beanstalk service reads configuration files in the .ebextensions directory in the application source bundle. These files contain instructions that configure the environment and application.
One of the configuration options available in the .ebextensions files is the "Packages" section. This section is used to specify packages that need to be installed on the EC2 instances that are created by Elastic Beanstalk.
Option A is incorrect because, within each package manager, package installation order is guaranteed. Elastic Beanstalk installs the packages in the order in which they appear in the .ebextensions configuration file.
Option B is correct because Elastic Beanstalk only supports the package manager "yum" for the Amazon Linux operating system. Elastic Beanstalk does not support "RubyGems" for package installation. Therefore, using "yum" in the configuration file is the only way to install packages on the Amazon Linux operating system.
Option C is incorrect because you can specify the version number of the package you want to install in the configuration file. The syntax is as follows:
yamlpackages: yum: package-name: version
Option D is incorrect because Elastic Beanstalk supports multiple package managers in a single .ebextensions configuration file. You can use either "yum" or "apt-get" for Amazon Linux, and "apt-get" or "dpkg" for Ubuntu.
In summary, when migrating an on-premises application to AWS Elastic Beanstalk, if the operating system is Amazon Linux and package managers yum and RubyGems are required, only yum can be used in the Packages section of the configuration file.