This assumes you have left the default VPC in place or that you have created your own VPC with a public network. Also, be sure to select the region you want to create a EC2 instance.
To launch an EC2 instance
- Sign in to the AWS Management Console
- Choose the region you wish to launch
- Choose EC2 Dashboard, and then choose Launch instance
- Choose the Amazon Linux 2 AMI
- Chose the t2.micro instance type (free tier)
- Click next to configure instance details
- Network: Choose the VPC with a public subnet (either default VPC or one you’ve created)
- Subnet: Choose an existing public subnet
- Auto-assign Public IP: Choose Enable
- Choose next to configure storage
- Keep the defaults and add a tag of your choosing:
- example: Key = “Name” and Value = “Test Server”
- Keep the defaults and add a tag of your choosing:
- Choose next to configure Security Group (or if you have already created a security group to allow SSH, then choose existing security group)
- Keep the defaults for SSH connectivity (except change source by clicking the down arrow and choosing My IP, unless you want it open to the public then 0.0.0.0/0 will work just great)
- Click Review and Launch
- On the Review Instance Launch page, shown following, verify your settings and then choose Launch
- Select an existing key pair or create a new key pair page
- To Create a new key pair and set Key pair name to any name you would like: for example, “TestKey” or perhaps “EC2Key”. Be very sure to Choose Download Key Pair (you will be using this key for connectivity potentially for all of your AWS exercises) , and then save the key pair file on your local machine. You use this key pair file to connect to your EC2 instance.
- To launch your EC2 instance, choose Launch Instances
- Choose View Instances to find your instance.
- Wait until Instance Status for your instance reads as Running
To Connect into your EC2 instance:
Goto Amazon’s EC2 connect guide as they have a great documentation on your choices of how to connect into an EC2 instance.
UPDATE YOUR EC2 INSTANCE
Once connected, run a linux update
sudo yum update -y
There ya go, launched and updated an AWS virtual server in just a few minutes
Next Steps
Perhaps you would like to Create a Web Server, if so ahead and go to the next module.
Caution: It is a good idea to remove an EC2 instance when you are finished with the instance, so as not to incur costs for leaving an EC2 running.
