Launch templates and AMIs (Amazon Machine Images) are both fundamental for launching EC2 instances on AWS, but they serve different purposes:
Here’s an analogy: Imagine an AMI as a recipe for a cake, specifying the ingredients (operating system, applications). A launch template would be like the baking instructions, including the oven temperature (instance type), baking time, and any additional steps (user data scripts). You can use the same cake recipe (AMI) with different baking instructions (launch templates) to create cakes with variations (different instance configurations).
In the EC2 dashboard, select Launch templates in the sidebar, then click Create launch template
In the launch template creation interface, under Launch template name and description, fill in Launch template name as AppTier-LaunchTemplate
Under the AMI selection, choose Owned by me then select AppTierImage
Choose Instance type as t2.micro
Keypair to Don’t include in launch template
Network settings:
Advanced details, IAM instance profile to ec2role
Scroll down to the bottom, select Create launch template. Done!