Amazon EC2-Compute Service In AWS

Amazon EC2-Compute Service In AWS

😊Overview of the Compute Services In AWS

Amazon Web Services (AWS) offers a diverse range of compute services that empower organizations to run applications, manage workloads, and scale resources with ease. These services provide the foundation for cloud computing and are designed to meet the unique needs of various use cases.

These compute services cater to a wide array of use cases, from traditional virtual machines to serverless computing and container management. AWS provides the flexibility and scalability required to meet the dynamic needs of modern applications and businesses.

🌐Amazon Elastic Compute Service (EC2)💻

Amazon EC2, often referred to as the workhorse of Amazon Web Services (AWS), is like a versatile toolbox for your computing needs in the cloud. It is designed to make your cloud infrastructure flexible while providing the reliability of a rock-solid foundation. Let's dive into what makes EC2 so awesome! 🚀

🤷‍♂️What is EC2? 🤔

Amazon EC2 is essentially a virtual playground where you can create and manage virtual servers known as instances. These instances can mimic various hardware configurations and run various operating systems. Amazon EC2 eliminates your need to invest in hardware upfront, so you can develop and deploy applications faster. Amazon EC2 enables you to scale up or down to handle changes in requirements or spikes in popularity, reducing your need to forecast traffic. 💻🕒

➡️Flexibility at Your Fingertips! 💪

One of EC2's most significant benefits is its flexibility. Whether you need a single tiny instance for a personal project or an army of powerful instances for a high-traffic website, EC2 has you covered. It's like having a wardrobe full of outfits for different occasions! 👔👗

➡️Scalability Galore! 📈

EC2 allows you to effortlessly scale your computing resources up or down to match the demands of your applications. Need more power during a traffic spike? Just click a few buttons, and EC2 will deliver! It's like having a magical growing potion for your servers! 🌟🔮

➡️Affordability & Pay-as-You-Go! 💲

AWS's pay-as-you-go pricing model means you only pay for what you use. EC2 offers a range of pricing options, from on-demand instances for flexibility to reserved instances for cost savings. It's like having a budget-friendly menu at your favorite restaurant! 🍔🍕

➡️Global Reach & Reliability! 🌍🔒

With data centers worldwide, EC2 provides global coverage for your applications. Amazon's robust infrastructure ensures high availability and reliability. It's like having multiple guardians watching over your server's well-being! 🌐🛡️

➡️Security & Control! 🔒🔐

EC2 allows you to define security groups, access control lists, and key pairs to secure your instances. You have full control over your virtual environment, just like locking your front door at home! 🚪🔑

➡️Endless Possibilities! 🌈🚀

From hosting websites and running databases to machine learning and big data analytics, EC2 empowers you to explore endless possibilities in the cloud. It's like having a playground for your imagination! 🌠🧠

➡️EC2 User Data.🚀👩‍💻
It is possible to bootstrap our instances using an EC2 User data script. Bootstrapping means launching commands when a machine starts. This script is only run once at the instance's first start.
EC2 user data is used to automate boot tasks such as: Installing updates, installing software, downloading common files from the internet, etc..
The EC2 User Data Script runs with the root user only.

➡️Some key components of Amazon EC2

  • AMI (Amazon Machine Image): 🖼️

    • AMI is a preconfigured template for launching EC2 instances. It includes the OS, tools, and applications.

    • It's region-specific, so choose the right AMI ID for your region when creating an EC2 instance.

  • Instance Types: 💻

    • Instance types define the CPU, compute power, storage, and memory of an EC2 instance.

    • There are various families like general-purpose, storage-optimized, and compute-optimized instances.

  • Elastic Block Storage (EBS): 📦

    • EBS is a storage service attached to EC2, similar to a hard drive.

    • Both EBS and EC2 must be in the same Availability Zone (AZ) for data storage.

  • Key Pair: 🔐

    • A key pair is essential for connecting to EC2 instances (via SSH).

    • It allows you to securely connect using tools like PuTTY and configure applications.

  • VPC and Its Components: 🌐

    • Amazon Virtual Private Cloud (VPC) lets you launch AWS resources in a user-defined virtual network.

    • It resembles a traditional network but leverages AWS's scalable infrastructure.

    • Default VPC and components are created when you create an AWS account, which you can use for your lab.

These components are vital for understanding and using Amazon EC2 effectively within the AWS ecosystem.

🧰Workshop Challenge🚧

  1. Create a new key pair

  2. Launch a Web Server Instance

  3. Connect to your Linux instance

  4. Connect to your Linux instance using Session Manager (Optional)

🔑Creating a Key Pair

A key pair comprises a public key (shared openly) and a private key (kept confidential). Public keys are associated with resources like EC2 instances or IAM users for secure access, while private keys are used for decryption and data signing. They ensure secure access and data protection across AWS services.

To create a key pair in AWS, follow these steps as sown in the video:

Following the above video we have successfully created an AWS key pair, and we can use it to securely access resources like EC2 instances. When launching a new instance, we can specify this key pair and the associated public key will be injected into the instance for secure SSH access.

🚀Launching a Web Server Instance

We will launch an Amazon Linux 2 instance, bootstrap Apache and install a basic web page that will display information about our instance.

🔗Connect to your Linux instance

There are several ways in which we can connect to our EC2 Instance. They are listed below:

EC2 Instance Connect

We can connect to your EC2 instance within your browser. There is no need to use the key file that was downloaded. The “magic” is that a temporary key is uploaded onto EC2 by AWS. It works only out-of-the-box with Amazon Linux 2 and Ubuntu as of now. We need to make sure that port 22 is still open in the inbound rules of the designated Security Group.

SSH Clients

We’ll learn how to SSH into your EC2 instance using Windows. SSH is one of the most important functions and It allows you to control a remote machine, all using the command line. We will configure all the required parameters necessary for doing SSH on Windows using the free tool Putty.

Session Manager

Session Manager is an AWS Systems Manager feature that is completely managed. Session Manager allows you to manage your edge devices, Amazon EC2 instances, and on-premises servers and virtual machines (VMs). It allows you to start a secure shell on your WC2 and on-premise servers without having SSH access or the need for Bastion Hostsor SSH Keys. So in this case we need not keep port 22 open in the inbound rules of the designated Security Group.. We need to install the SSM agent onto the systems we control To know more you can check this page.
To know more you can check this page rupak1chakraborty.hashnode.dev/aws-systemsm..

🙌Conclusion

Amazon Elastic Compute Cloud (EC2) serves as a fundamental building block within the framework of cloud computing infrastructure. Throughout this assignment, we have delved into the essential concepts of EC2 and engaged in practical hands-on labs. I firmly believe that my active participation in this meticulously crafted workshop and dedicated work on this assignment will significantly elevate my understanding and expertise in the realm of EC2, fostering substantial growth in my knowledge and skill set.

✉Endcard

🎉 Thank you for joining me on this insightful journey into the world of AWS EC2!

❤ If you found this blog helpful and informative, don't forget to give it a like!

👉 Stay updated with my latest posts and never miss out on exciting content! Click that Follow button to join and stay in the loop!

👔 Follow me on Linkedin --> rupak1chakraborty

Stay tuned for more such contents...👋🔍🌈