Launch EC2 Instance
Launch EC2 Instance
This launches an EC2 instance in VPC
my-vpc
, not yet accessible viaSSH
.
Resource Parameters
The following parameters are needed when following these steps to launch a new EC2 instance.
- VPC Name and Region
- Instance AMI and Type
Throughout this guide we use the following example EC2 Instance parameters.
- VPC
- Name
my-vpc
in regionus-east-1
- Name
- Instance
- Name
Amazon Linux AMI (HVM) 64-bit (x86)
- Type
t2.micro
- Name
Launch the EC2 instance
Navigate to the EC2 Launch an instance form.
Check your selected region
Make sure you have selected the desired region, ex: US East (N. Virginia) us-east-1
.
Complete the wizard with the following details:
- AMI:
Amazon Linux AMI (HVM) 64-bit (x86)
- Instance Type:
t2.micro
- Create a new key pair called
my-key-pair
or select the existing one - Network settings
- Network:
vpc-xxx (my-vpc)
- Auto-assign Public IP:
enable
- Firewall (security groups)
- Select an existing security group:
default VPC security group
- Select an existing security group:
- Network:
- Configure storage:
(defaults)
Info
You can replace these AMI, Instance Type and Network VPC Name example values with your desired values.
Click Launch
Navigate to the VPC Management Console Security Groups table.
Check your selected region
Make sure you have selected the desired region, ex: US East (N. Virginia) us-east-1
.
Filter the security groups by selecting a VPC
and select the default
security group.
- VPC:
vpc-xxx (my-vpc)
- Security Group:
default
- Edit Inbound Rules
- Add Inbound Rule
- Type:
SSH
- Source type:
My IP
- Type:
- Add Outbound Rule (if not exists)
- Type:
All traffic
- Destination:
Anywhere-IPv4
- Type:
Info
This makes the launched EC2 instance accessible via SSH
.
Access the EC2 Instance via SSH
This accesses your EC2 instance via
SSH
.
Navigate to the EC2 running instances dashboard.
Check your selected region
Make sure you have selected the desired region, ex: US East (N. Virginia) us-east-1
.
Select your recently launched EC2 instance to see the instance details. Copy the Public IPv4 address
to the clipboard and note the Key pair name
.
Execute the following ssh
command to access your EC2 instance.
ssh -i ~/.ssh/<instance-key-pair-name>.pem ec2-user@<instance-public-ipv4-address>