Creating EC2 instance on AWS !

Creating EC2 instance on AWS !

In this article, you will create a new Amazon EC2 instance running Ubuntu. Before launching and connecting to an Amazon EC2 instance, you need to create a key pair, unless you already have one. You can create a key pair using the Amazon EC2 console and launch your EC2 instance.

  1. Open the AWS console

  2. Search for ec2

3. EC2 Dashboard will be opened, choose instances(running).

4. Click launch instances.

5. Name the instance and choose the OS image — (Ubuntu)

6. Select the instance type — (here we choose t2.micro)

7. Choose the key-pair if it already exists or else click create new key pair

  • click create new key-pair

  • Name the key

  • choose RSA

  • Choose .pem

  • click create key pair

  • save the .pem key in your local machine, (so, while connecting navigate to the .pem key location and connect with the remote machine)

8. Keep the network settings as follows, setting it to ‘My IP’ will save you money.

9. Check for the summary and launch instance

10. It will take a few seconds to create an instance and display the success status.

11. Now, go inside the instance and check for status(running)

12.Launch an EC2 instance using CLI -

“aws ec2 run-instances --image-id ami-xxxxx --count 1 --instance-type t2.micro — key-name <<MyKeyPair>> --security-group-ids sg-xxxxx --subnet-id subnet-xxxxx”

  • Display your AWS EC2 key pair -

“aws ec2 describe-key-pairs --key-name MyKeyPair”

  • Delete your keypair -

“aws ec2 delete-key-pair --key-name MyKeyPair”

. To Delete, select an instance, do as follow

  • choose the instance

  • actions → Terminate Instance(Delete)

In conclusion, creating an EC2 instance can seem like a daunting task, but it is a fundamental aspect of using Amazon Web Services. With the right knowledge and guidance, anyone can create an EC2 instance and launch their virtual server in the cloud. By following the steps outlined in this article, you can create your instance and start exploring the many features and capabilities of AWS. With EC2 instances, the possibilities are endless, and you have the power to scale your infrastructure to meet the demands of your application. So, take the first step today and create your own EC2 instance to begin your cloud computing journey.