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,
Navigate to your AWS EC2 dashboard.
Under "Instances", select "Launch Templates".
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.
Launch template name (Example): PostgreSQL-Ubuntu
Template version description (Example): PostgreSQL server instance template for project.
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.
In the search box, type "Ubuntu Server 20.04 LTS".
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.
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.
According to AWS EC2 Instance Types page, an M4 instance is best used for "small and mid-size databases."
The EC2 on-demand instance price for an "m4.large" instance (2 vCPUs) is $0.10 per hour, which works well for our budget.
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.
If not already highlighted, select Virtual Private Cloud (VPC).
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.
Select "Volume 1"
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.
Create a name for your key and value
EX. PostgreSQL (Key) AND Database (Value)
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