DevOps 7.2 : Getting Started with EC2

๐Ÿš€โœจ "Embark on Your Cloud Journey: Navigating the Basics of EC2" ๐Ÿ’ป๐ŸŒ

ยท

3 min read

DevOps 7.2 : Getting Started with EC2

What is EC2 ?

Amazon Elastic Compute Cloud (Amazon EC2) is a web service provided by Amazon Web Services (AWS) that offers resizable compute capacity in the cloud. It allows users to run virtual servers, known as instances, on-demand. EC2 instances provide a scalable and flexible computing solution, enabling users to easily scale their applications as computing requirements change. EC2 is a fundamental building block of AWS, providing the compute capacity needed to host applications ranging from simple web servers to complex machine learning workloads.

What are the components in EC2 ?

Amazon Machine Images (AMIs): An AMI is a pre-configured virtual machine image, including an operating system and often additional software. Users can use existing AMIs or create custom ones.

Instances: These are the virtual servers in the cloud. Users can launch instances with different configurations, such as varying CPU, memory, storage, and network performance.

Elastic Block Store (EBS): EBS provides block-level storage volumes that can be attached to EC2 instances. It allows users to create persistent storage volumes that persist independently of the life of the instance.

Key Pairs: EC2 instances can be accessed securely using key pairs. A user stores one part of the key pair (the private key) securely and provides the other part (the public key) when launching an instance.

QuickStart EC2 -

Steps are as follows:

  1. Log In to aws account.

  2. Search for EC2 in the search bar.

  3. Click on instances in the sidebar. And Click Launch Instances.

  4. Give the project name as web01 and you can addition key-value tags for filtering.

  5. Then click on Browser AMIs and search for centos in AWS Marketplace AMIs and go for Centos Stream 9 which is an free AMI.

  6. In instance type select t2.micro which is free tier eligible.

  7. Then click on Create new key pair and match below

  8. In network settings you can edit or keep the default settings if you want to.

  9. In advance detail you can scroll till the bottom and copy the below detail. This is like vagrant provisioning. It will run the commands when the instance starts running.

  10. Then launch the instance. As you can see the instance is launched.

Lets connect to the instance -

  1. Click on the instance and click on the connect option.

  2. Select the option ssh client

  3. Copy the example and paste it in your local terminal and replace web-dev-key.pem with the location of the key you have downloaded.

    e.g. - ssh -i /Downloads/web-dev-key.pem

  4. As you can see the the httpd service is up and running.

  5. For accessing the apache test webpage, you can access it using the public IP.
    But first we have to add port 80 into our security group i.e. by editing the inbound rules.

  6. Then terminate the instance to avoid unnecessary charges.

Conclusion:

In this concise guide, we delved into the swift deployment of EC2 instances, mastering the essentials like security groups and tags. Connecting seamlessly through SSH, we've laid the foundation. Stay tuned for deeper dives into EC2's rich capabilities in our upcoming blogs

Did you find this article valuable?

Support Chronicles of Tech ๐Ÿ“š๐Ÿ’ป by becoming a sponsor. Any amount is appreciated!

ย