Project Documentation: Creating an Auto Scaling Group with AWS CLI v2

Nicole Ann Hargrove
2 min readApr 28, 2021
AWS CLI

This is another project from my Level Up In Tech AWS DevOps Boot Camp.

Using AWC CLI v2 to interact with EC2, IAM and Auto Scaling Groups.

Scenario

Working with the AWS Command Line Interface (AWS CLI) is an essential skill. Some computing environments are headless, meaning there is no Graphical User Interface (GUI) installed nor not permitted or there might be a quick task to accomplish and using the AWS CLI is the right tool to accomplish this.

In this tutorial, your team has come to you to set up an Auto Scaling Group (ASG) using only the AWS CLI. This tutorial will empower you to use the AWS CLI to work with EC2, IAM and Auto Scaling Groups services.

Tasks

To accomplish this scenario, we will use the AWS CLI to execute the following:

  • Create an IAM user and grant programmatic and console access.
  • Create an EC2 instance using the AWS CLI.
  • Create a Launch Template from the EC2 instance.
  • Create an Auto Scaling group from a Launch Template.
  • Clean up the AWS Environment.

In order to proceed with this tutorial, ensure your environment meets the following criteria:

  • I am using the components of the Default VPC. Note down the subnet-id and security-group-id for where the EC2 instance will be launched and have access to a key pair.
  • AWS CLI v2 installed. Follow the steps in the AWS Command Line Interface User Guide documentation to install AWS CLI v2.
  • AWS CLI has been configured. Follow the steps in the Configuring the AWS CLI documentation to configure with a Region in us-east-1 and Output format of json.
  • AWS CLI Command Reference documentation will be heavily utilized in this tutorial so it is a good idea to bookmark it.
  • I am adding the new user to an existing group called SysAdmins. The permissions policies for this group is the AWS managed AdminstratorAccess.

Tip: If using PowerShell and you cannot fit commands on one line use the backtick or a grave accent (`) to continue to a new line. Once done with the command do not put a backtick but hit enter to execute the command. On a QWERTY keyboard it is located under the tilde (~) key.

Type command <space>` and hit enter.

Example of using backtick(`)

Download Creating an Auto Scaling Group with AWS CLI.pdf from my Google Drive.

Please post your feedback.

--

--

Nicole Ann Hargrove

20+yrs of IT Industry expertise from working in and with global corporations in Cloud, Integration and Digital Experiences domains as Solutions Architect.