How to Launch EC2 instances in the different region using the same key pair on AWS

To Launch EC2 instances in different region using a same key pair on AWS

Introduction:

Amazon Web Services is a subsidiary of Amazon rendering on-demand cloud computing platforms and application programming interfaces to selves, organizations, and governments, on a metered pay-as-you-go basis. Amazon Elastic Compute Cloud (Amazon EC2) is a web service that provides reliable, resizable measuring capacity in the cloud that is designed to create web-scale cloud computing more convenient for the developers. It renders total control of computing resources that can run on Amazon's proven computing environment. This tutorial will show you to Launch EC2 instances in different regions using the same key pair on AWS.

Procedure:

switch your AWS console and login your account Now I will create a VPC. I have already posted a video for VPC and EC2 creation if you have any doubt about VPC and EC2 instance creation please refer that video

VPC creation Video: https://www.youtube.com/watch?v=tffhGE48e4o&t=115s

EC2 instance Video: https://www.youtube.com/watch?v=s9traU-3fQI&t=15s

The VPC is created Now create a subnet for that VPC. Finally, the subnet is created By default, while you are creating a subnet the route table also create along with the VPC creation. Here I will change the name of route table Now create Internet Gateway for that VPC then attach the Internet Gateway to the VPC Now define a policy for internet gateway Now create EC2 instance using the VPC Then the same way follow to create VPC, Internet Gateway Instance to another Region We need Public key or create an instance to import the key pair to another region. For that go to Mumbai region and launch instance and type the below command Here you can see than public key copies the entire key and go to key pair window on another region and create a key pair name and paste the key to the text box then click Import key pair Then create instance using the key pair. Now the instance is created and then launch the instance Finally, launch the instance using the different region Key pair With this method, to create a Launch EC2 instances in different region using a same key pair on AWS comes to an end.

FAQ
Q
What is the IP range of a default VPC?
A
The default VPC CIDR is 172.31.0.0/16. Default subnets use /20 CIDRs within the default VPC CIDR.
Q
How many default VPCs can I have?
A
You can have one default VPC in each AWS region where your Supported Platforms attribute is set to "EC2-VPC".
Q
Why should I use Amazon VPC?
A
Amazon VPC enables you to build a virtual network in the AWS cloud - no VPNs, hardware, or physical datacenters required. You can define your own network space, and control how your network and the Amazon EC2 resources inside your network are exposed to the Internet.
Q
What are the components of Amazon VPC?
A
A Virtual Private Cloud, Subnet, Internet Gateway, NAT Gateway, Virtual private gateway, Peering Connection, VPC Endpoints.
Q
What is Amazon Virtual Private Cloud?
A
Amazon VPC lets you provision a logically isolated section of the Amazon Web Services (AWS) cloud where you can launch AWS resources in a virtual network that you define. You have complete control over your virtual networking environment, including selection of your own IP address ranges, creation of subnets, and configuration of route tables and network gateways.