EC2 and AMI Fundamentals and Setup

EC2 and AMI Fundamentals and Setup

?? Exploring AWS EC2 and AMI Basics! ??

Building on the knowledge I gained about Virtual Private Clouds (VPC) in my last post, I have deployed my first EC2 instance into the default VPC.

Here is a cleaned up version of the notes I took and process I went through to set up the EC2 instance and connect to it via an ssh key on Windows.


?? Amazon EC2 (Elastic Compute Cloud):

Amazon EC2 provides scalable computing capacity in the AWS Cloud. It allows you to launch virtual servers, known as instances, to run applications in a secure and reliable environment.

If you need to deploy and manage any type of compute, EC2 is the service for it.

An EC2 instance is basically a configurable OS with different sizes and capabilities such as advanced storage and GPU.

One of its key features is scalability, allowing you to quickly scale up or down the capabilities of the instance based on demand.

Another is flexibility as it offers a wide range of instance types optimized for different use cases.

It is also very cost-effective and the charge is divided into categories including CPU usage, memory consumption, storage and networking. While most of these charges can be stopped by simply turning off the instance, storage costs will still be incurred.


??? Amazon Machine Images (AMIs):

An AMI is a template that contains the software configuration (OS, application server, and applications) required to launch an EC2 instance. It also contains permissions to dictate who can communicate with the instance.

Amazon provides many templates providing ready-to-use settings for your instances. Third parties may also provide public AMIs such as Windows and Linux. You also have the ability to customize and create your own AMIs by saving the configuration of a customized instance.

Some of these AMIs are on the free-tier of AWS and can be easily played around with.


??? Setup Workflow:

  1. Choose an AMI that suits your requirements, such as Ubuntu, Amazon Linux, or Windows.
  2. Launch an instance by configuring details like instance type, key pairs, security groups, and storage, or just use the default if your goal is just to learn.
  3. Create an ssh key pair. You can choose between a .ppk or .pem file. While .pem is more common for users on a MAC or Linux system, both can be used for Windows although I opted for .pem.

They key pair has 2 parts- public and private. Once the keypair is created, the .pem file is downloaded and you can move this to a suitable directory. When you try to connect to the instance, you provide the private side of the keypair and AWS will recognize that it matches with the public half and allow you to connect.


?? Connecting to an EC2 Instance via SSH:

On macOS and Linux:

  1. Open Terminal.
  2. Navigate to the directory containing your private key file (e.g., my-key.pem):
  3. Modify the permissions of your private key file: chmod 400 my-key.pem
  4. Run the command to connect to your EC2 instance: ssh -i "my-key.pem" ec2-user@your-ec2-instance-public-dns

These commands can also be found by right-clicking on your instance, selecting connect and navigating to the SSH pane.


On Windows (using Command Prompt or PowerShell):

Windows is mostly the same except the chmod command will not work.

Instead, you have to right-click on the .pem file and go to properties -> security -> advanced -> disable inheritance.

Once here, you should remove all access apart from your own user.

Without doing this, the command prompt will complain that the permissions of the .pem are too open and should be restricted as multiple users may have access to it.

Once done, running step 4 in the MAC and Linux section above should work.


?? Conclusion

Understanding EC2 and AMIs is crucial for designing scalable and resilient architectures in the cloud. They provide the foundation for deploying and managing applications efficiently and securely.

I’ve taken good notes on these as I know it will be important for the exam, and very useful to understand for continued success in my job.

I know I will go into more depth on this later in the course. For now, if you have any tips or you spot any errors or gaps in what I've written, please drop them in the comments! ????

#AWS #CloudComputing #AWSEC2 #AWSAMI #SolutionsArchitect #LearningJourney #CloudArchitecture

Sajjad Ahmad

Full Stack Web Developer @ FIVERR | Building Scalable Web Applications

8 个月

Insightful!

回复

要查看或添加评论,请登录

Jamie Furlong ??的更多文章

  • Organizing Data with AWS S3 Buckets

    Organizing Data with AWS S3 Buckets

    Another week has gone by with another module completed. At the beginning I thought, how complicated can S3 buckets…

  • AWS Organizations: Streamline and Scale Your Cloud Environment ??

    AWS Organizations: Streamline and Scale Your Cloud Environment ??

    It's been a minute since my last post. Returning home, turning 30, climbing Ben Nevis, organizing a massive party and…

    1 条评论
  • AWS Solutions Architect - Preparing for Failure

    AWS Solutions Architect - Preparing for Failure

    Fault Tolerance vs High Availability vs Disaster Recovery: A Beginner's Guide One thing I have learned very quickly…

  • AWS Virtual Private Cloud Fundamentals

    AWS Virtual Private Cloud Fundamentals

    Understanding AWS VPC: The Basics ?? Hey everyone! After a week break for my 30th, I've continued my studies for the…

  • Exploring the OSI Model

    Exploring the OSI Model

    As I delve deeper into my AWS Solutions Architect studies, I’ve found it crucial to understand the foundational…

  • AWS Secure Setup and IAM Users

    AWS Secure Setup and IAM Users

    This week, I began studying the AWS Solutions Architect Associate through a course created by Adrian Cantril. I chose…

社区洞察

其他会员也浏览了