4.8-Building the Launch Template

Manual launch vs. Launch template

In the AWS EC2 (Elastic Cloud Computing), manually launching a virtual machine is a 7-steps process, during which you can or have to choose/specify many options :

We'll facilitate the launch process here by taking advantage of a relatively recent AWS feature : we'll record our option choices in a "Launch Template", that we'll then use to launch our server in a much quicker way.

Checking the "free elligible" Instance type in your AWs Region

Going to the second step above : "Choose Instance Type" (and then pressing Cancel to abort the process) is a good idea anyway, because it will show you what the "free elligible" Instance type is for your current AWS Region : currently t2.micro or t3.micro.

For example, in Oregon :

At step 2 you see that the "Free tier elligible" Instance type in Oregon is currently t2.micro :

You can then click "Cancel" to exit the process.

New Launch Template

In the EC2 console, let's click "Launch Templates" in the menu on the left side, and then "Create Launch Template" to get this form :

For the first part :

  • keep "What would you like to do ?" as "Create a new template"

  • give a Launch template name like my "my-fg-ovpn-201907" above

  • give a Template version description as you whish

  • the "Source template" stays empty since this is your first one.

The "Launch template contents" section

AMI ID

The first choice is about the AMI = Amazon Machine Image. This is like the backup of a pre-built installation, that will be copied over to your own virtual machine to initialize it.

We use the Search for AMI link and we'll select one from the "Quick start" AMI catalog : the "Amazon Linux AMI YYYY.MM.v (HVM), SSD Volume Type" (YYYY.MM.v = 2018.03.0 as of this writing).

Your choice will appear as an "AMI ID", which is different for each region : the same "Amazon Linux AMI 2018.03.0 (HVM), SSD Volume Type" gives AMI ID = ami-8c169ef2 in Stockholm while at the same moment it gives ami-0bdfa1adc3878cd23 in London and ami-0f2176987ee50226e in Oregon...

After confirming, the AMI ID is populated in the main form.

Instance type

The second one is the Instance type, defining the size of virtual "core hardware" (CPUs and RAM). There are many instance types, grouped in different families, of very different sizes and hourly cost !

We'll use an instance type that is "free elligible" for the AWS region : generally t2.micro

(t3.micro is "free elligible" ONLY in regions where t2.micro is not available)

Depending on your region, one of these 2 types will be available as "free elligible" :

  • either t2.micro (generally)

  • or the recent t3.micro in some regions without t2.micro

In AWS regions where BOTH t2.micro and t3.micro are available :

ONLY t2.micro is "free elligible"

So search for t2.micro first in the list, and only if not found then choose t3.micro

In Stockholm as of July 2019, t2.micro is not available and t3.micro is "free elligible", so for this demo : t3.micro it will be and "free elligible" it will remain :

Key pair name

We only created 1 Key pair, so this is an easy choice...

Network type

VPC ! For a new account, you don't even have access to the legacy "EC2 Classic" - and you don't even want to know what it was...

Security Groups

We created one just for our setup, so let's select it !

You can see that you can assign multiple security groups, so if you have different security groups for different kinds of network traffic authorization, you can cumulate them.

Our choices so far, for this demo :

As of July 2019, for the "free elligible" instance type, you would have t2.micro instead of t3.micro in most regions other than Stockholm.

Network Interfaces, Storage (Volumes) and Instance tags

Step over these three blocks without touching them

We'll use the default network interface and storage options, and we don't need tagging.

Advanced details : expand !!

We need to specify 2 options in this section :

  • IAM instance profile

  • User data

Don't touch to the other options !

(unless you're already outside the Free Tier AND you know what you're doing...)

IAM instance profile

Here you have to specify the IAM Role you created earlier :

User data

Here you'll have to copy/paste the contents of your own "config.name"-userdata.sh

Here is ours for this demo (with our 2 edited lines highlighted) :

Now, we can confirm our choices !

By clicking the blue "Create launch template" button at the bottom...

...We now have a Launch Template ready to use !

Last updated