Skip to main content

Command Palette

Search for a command to run...

AWS EC2 Automation

Published
3 min readView as Markdown
AWS EC2 Automation

Launch Template in EC2

A Launch Template in Amazon EC2 is a configuration resource that simplifies and standardizes the process of launching EC2 instances. It allows you to define a set of instance settings, such as the AMI, instance type, security groups, and other parameters, in a single template. This template can then be used to launch multiple instances with the same configuration, making it easier to maintain consistency and manage your instances.

Instance Type

Amazon EC2 has a large number of instance types that are optimised for different uses. The different combinations of CPU, memory, storage and networking capacity in instance types give you the freedom to choose the right mix of resources for your apps. Each instance type comes with one or more instance sizes, so you can adjust your resources to meet the needs of the workload you want to run.

If you want dive deeper into ec2 and it's instance type, here is the official documentation link

Amazon Machine Image (AMI)

An Amazon Machine Image (AMI) is an image that AWS supports and keeps up to date. It contains the information needed to start an instance. When you launch an instance, you must choose an AMI. When you need multiple instances with the same configuration, you can launch them from a single AMI.

To-day'z task

Create a launch template with Amazon Linux 2 AMI and t2.micro instance type with Jenkins and Docker setup

for creating a launch template first you need to launch a instance and the make a template out of it , so for today's task you have to first launch a instance with the userdata script so for this you may follow the day 39 blog where we have done the same

today we are starting for creating a launch template from that ec2 instance.

for creating a template go to ec2 dashboard

make sure instance is up and running.

it will redirect to launch template dashboard and a select source instance will be attached which mean that the template will inherit all the configuration of the choosen instance.

enter the template name and the description.

check the summary and click on "Create launch template."

once the template is created it will reflect here

here we have successfully created the launch template

Create 3 Instances using Launch Template, there must be an option that shows number of instances to be launched ,can you find it? :)

let's complete this task also here

now to create a instance from the template follow this steps

once you click all the template configuration will be inherited by a instance

you can also modify the template here like if you want to change the instance type and many more configuration , you can modify it here .

now according to the task we need to run three instance at the same time form this template so for this follow this step

select the number of instance you want

now click on launch instance...

and that's it, we have successfully created the launch template and after that we also tested that template and created the three template out of it .

Happy learning....spread love

follow me on LinkedIn.

More from this blog

DevOps Hustlers

56 posts