Creating an AWS EC2 Instance
In this article, we will walk through the process of creating an AWS EC2 instance.
Prerequisites:
- Firstly, the user has to create an AWS account in order to launch the EC2 instance.
- Next, create an IAM user account that has admin privileges or privileges with full access to IAM, EC2, S3, VPC services, etc with access type enabled for both programmatic access and AWS management console access. ( NOTE: Don’t use root credentials for any of your learning or production-related activities as best practice)
Assuming, users have access to their AWS accounts and log in using their IAM user credentials.
Go to AWS Console->Click Services->Click EC2 under Compute
When you click EC2, you will see an EC2 Dashboard, which looks like:
Click ->Launch instance
Select any one of the AMAZON AMAZON IMAGE(AMI), according to your need and select next. For now, I will be selecting Ubuntu Server 18.04 LTS (HVM), SSD Volume Type.
Next select instance type according to the vCPUs, memory(GIB), instance storage according to your need, and then select next: configure instance details. In my case, I was selecting t2.micro as my instance which has 1 virtual CPU, 2 GIB.
You can keep all the default values as it is and ensure you are selecting default VPC as it has public subnets that allow traffic from the outside world under the Network field and if you have your own VPC select that VPC->Click Next: Add Storage.
You can change the default volume size as our needs and keep all other values as default
Click Next: Add Tags
Add Tags to your EC2 instance to label your AWS resource and easily recognize your machine for running your commands using Key, Value details >Click Next: Configure Security Group
Select Create a new security group->Add the Security group name and description and under type select SSH & Custom TCP as network protocol and ensure you are selecting source as My IP as it takes your current machine IP and allows incoming traffic to your EC2 instance. Don’t select source as anywhere 0.0.0.0/0 as this will give access to open network and allows open traffic to flow which is a potential threat to your organization.
NOTE: The source IP can change when you change your network connectivity from wifi or any other network. So to ensure you have access to this instance go to the security group and click on My IP to capture your latest IP of the source machine->Click Review and Launch.
You can preview all the configuration details you have entered and Click Launch->It will ask you to select any key pair. If you have existing select the existing key pair, if not select Create a new key pair option->Enter the name of keypair->Click on Download key pair->and then Click Launch instances.
You will get a new dashboard with your instance ID details. Click on the instance id it will point to your EC2 instances page.
Congrats…!, you have launched your first EC2 instance.
If you want to connect to the EC2 instance, which we have launched just now, refer https://medium.com/@dileepjallipalli/connecting-to-aws-ec2-instance-using-putty-from-windows-f914b258cadd.