Create Launch Template

Configurations for launch template

If we want to create an auto scale group, we first have to create the launch template for our instance. The launch template will be used by our auto scale group to add instances that all have the same configuration.

To open the launch template configurations,

  1. Navigate to your AWS EC2 dashboard.

  2. Under "Instances", select "Launch Templates".

  3. Select "Create launch template".

Launch template name and description

These settings can be customized for your server, but I've provided examples for you to use during your set-up.

  1. Launch template name (Example): PostgreSQL-Ubuntu

  2. Template version description (Example): PostgreSQL server instance template for project.

  3. Auto Scaling guidance (optional): Check box if you'd like although I did not see a need for it

Amazon machine image (AMI)

For this documentation, we will use an Ubuntu 20.04 machine. This was the preferred machine for our set of tasks, but another machine could serve as an acceptable substitute.

  1. In the search box, type "Ubuntu Server 20.04 LTS".

  2. Select the option where "architecture: 64-bit (x86)"

Note about AMI: The instructions in this document are catered towards this AMI; choosing a different machine may require following a different set of instructions.

Note about AMI Architecture: When selecting the machine, you will note that two Ubuntu 20.04 options will appear. They differ in their architecture: (Intel) x86 and ARM. To quote this StackOverflow post discussing their difference, ARM "is a simpler architecture, leading to small silicon area and lots of power save features", whereas Intel x86 is "a power beast in terms of both power consumption and production."

As I am no expert in computer architecture, and I am furthermore assuming they can both serve our purposes, I decided that the "power beast" option sounded much more attractive.

Instance type

Since this instance will be launched in our auto scale group, we will select an instance type with 2 vCPUs.

  1. In the search box, type and select "m4.large".

Note about Auto-Scale: If the auto scale sees a rise in demand, it will add another instance with 2vCPUs, resulting in our server having 4 vCPUs at its disposal.

Note about Instance Type: We'll be selecting an "M4" instance.

Key pair (login)

I would recommend adding a key pair in order to SSH into your machine. However, this is up to you.

As of writing this documentation, AWS has a feature called "EC2 Instance Connector" that allows you to enter your machine through AWS on your browser, and you do not require a key pair.

However, if you want other members of your project team to access your machine through SSH without a key pair, I will refer you to this Stack Overflow forum:

Either way, here are your options:

  • If you do not want to associate a key pair, leave the default setting: "Don't include in launch template"

  • Recommended: If you do want to associate a key pair, select a key pair you've previously made from the drop down menu, or select "Create new key pair" to create a new one.

Network settings

For our case, we'll be using our Virtual Private Cloud (VPC). Also, we'll select our security group that we made in the previous section to attach to our instances.

  1. If not already highlighted, select Virtual Private Cloud (VPC).

  2. Security group: Select the security group created in previous section

Storage (volumes)

I increased the volume size from 4 to 100 GiB. You may choose whatever storage volume fits your needs.

  1. Select "Volume 1"

  2. Change size (GiB) (Example): Type "100"

Resource tags

Adding tags to all our launch template instances will be important when we want to backup our EC2 instance in a later section.

  1. Create a name for your key and value

    • EX. PostgreSQL (Key) AND Database (Value)

  2. From Resource types, select "Instances" and "Volumes"

Feel free to further customize your launch template for your needs. Once you've finished, select "create launch template". Your template is ready to be used!

Last updated