AWS Certified Solutions Architect - Associate Exam: Pre-installing Software in Auto Scaling Group Instances

Pre-installing Software in Auto Scaling Group Instances

Prev Question Next Question

Question

You create an Auto Scaling Group which is used to spin up instances on demand.

As an architect, you need to ensure that the instances are pre-installed with software when they are launched.

What are the different ways to achieve this? (Select Two)

Answers

Explanations

Click on the arrows to vote for the correct answer

A. B. C. D.

Correct Answers - B and C.

The instance launch's User data section can be used to pre-configure software after the instance is initially booted.

For more information on User data, please visit the below URL-

https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/user-data.html

Also, you can create an AMI or a golden image with the already installed software.

Then create a launch configuration that can be used by that Auto Scaling Group.

For more information on AMIs, please visit the below URL-

https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/AMIs.html

As an AWS Solutions Architect, you can ensure that the instances launched by the Auto Scaling Group (ASG) have the required software pre-installed in two ways:

  1. Add the software installation to the configuration for the Auto Scaling Group: In this method, you can create a custom Amazon Machine Image (AMI) with the required software installed and then configure the Auto Scaling Group to use that AMI. You can use any method to create the AMI such as EC2 Image Builder, AWS CLI, or AWS Management Console. After creating the AMI, update the launch configuration of the ASG to use this custom AMI instead of the default AMI. By doing so, each instance launched by the ASG will have the required software pre-installed.

  2. Add the scripts for the installation in the User data section: In this method, you can use the User data section of the EC2 instance to specify the commands to install the software. User data is a script that runs when the instance launches. You can add the required commands to install the software in the User data section while launching the instance. When the instance is launched, the script in the User data section runs automatically and installs the software. You can use any scripting language like Bash, PowerShell, or Python to write the installation script.

Options C and D are not correct: C. Create an AMI and then create a launch configuration: This option is similar to option A but is not entirely correct. The correct approach is to create a custom AMI with the required software installed and then use it in the ASG launch configuration. D. Ask the IT operations team to install the software as soon as the instance is launched: This option is not recommended because it is manual and error-prone. It may take time for the IT operations team to install the software, which can lead to delays and may not scale well.