In this hands-on lab, we will use CloudFormation to provision a basic infrastructure environment with an EC2 instance. There are many different basic infrastructures you could build with CloudFormation, and this lab is just one example. We will complete several objectives throughout this lab, including creating an EC2 key pair, using a CloudFormation template to deploy a basic infrastructure with an EC2 instance, and finally logging in to the instance via SSH to demonstrate the CloudFormation stack provisioned and deployed the environment correctly.
Successfully complete this lab by achieving the following learning objectives:
- Create an EC2 Key Pair and Use the Provided CloudFormation Template to Provision an EC2 Instance
- Navigate to EC2.
- On the left-hand menu, click Key Pairs.
- Click Create Key Pair, and add a name. Remember to save this information somewhere safe.
- Navigate to CloudFormation.
- Click Create stack.
- Copy and paste the provided CloudFormation template, and add our newly created EC2 key pair as a parameter. Please Note: Template must be copied into the template tab (on the bottom of the Cloud Formation Dev screen) with JSON selected.
- Deploy the sample network configuration stack.
- Use the EC2 Public IP Address and the Terminal to Ping the Instance
Use the Linux Academy Cloud Playground terminal or your own terminal to log in to our newly created EC2 instance via SSH to verify our CloudFormation template provisioned and deployed a basic infrastructure.