In this article, we will see the following Create AWS EC2 Instance Using Cloud Formation.
Steps to Follow :
- Logging to AWS Account
- Create a Key Pair
- Create Stack for creating AWS EC2
- Verify EC2 Instance Graphically
- Connect to EC2 Instance Using Putty
1. Logging to AWS Account
First, we need to AWS Console page by using the below link.
Click on sign in to Console button. Logging to aws account
Login using username & password and click on sign in. Enter to AWS Management Console
We can see the AWS Management Console Dashboard. Go to Services, under the compute module click EC2 service to open.
2. Create a New Key Pair
Go to keypairs and click on Create key pair.
Specify key pair Name “ktexperts_key” and select file format “ppk” and click on create key pair.
Once click on create key pair the file will be downloaded automatically in your physical location.
We can the key pair “ktexperts_key” which was created.
3. Create Stack for creating VPC
Go to Services, under the Management & Governance module click Cloud Formation service to open.
Click on Create stack.
Upload template file
Select Template is ready and click on Upload a template file.
select file “createec2.yml” and click on open.
the file has uploaded and click on Next.
Specify stack stack name “ktexperts-vpc” and click on Next.
click on Next.
Click on Create stack.
we can see the vpc creating is being in progress, It will take time to create.
We can see the vpc “ktexperts-vpc” has created successfully.
4. Verify EC2 in Graphically
Go to Services, under the Networking & Content Delivery module click EC2 service to open.
we can see the instance “Ktexperts-EC2” which was created.
5. Connect to Linux EC2 Instance Using Putty
We can connect putty by using below link. Connect to EC2 Instance Using Putty
We can see the Linux EC2 Instance Terminal.
login as: ec2-user
Authenticating with public key "ktexperts_key"
__| __|_ )
_| ( / Amazon Linux 2 AMI
2 package(s) needed for security, out of 13 available
Run "sudo yum update" to apply all updates.
Script for Creating an EC2 Instance:
ImageId: ami-0e306788ff2473ccb # Amazon Linux AMI
- Key: Name
Thank you for giving your valuable time to read the above information.
Follow us on
Website : www.ktexperts.com
Facebook Page : KTexperts
Linkedin Page : KT EXPERTS
Ramesh’s Linkedin : Ramesh Atchala