Skip to content

Amazon Web Services

Jason H Ky edited this page Dec 13, 2023 · 29 revisions

What is Amazon Web Services?

Amazon Web Services(AWS) is a comprehensive and widely used cloud computing platform provided by Amazon which offers a vast array of on-demand services that businesses and individuals can use to build and manage their applications and infrastructure in the cloud. AWS provides a scalable, flexible, and cost-effective solution for hosting websites, running applications, storing data, and more.

What is Cloud Computing?

Cloud computing is a technology model that allows access to a shared pool of computing resources over the internet. Instead of owning and maintaining physical hardware and infrastructure, users can leverage cloud services to access computing power, storage, databases, networking, software, and other resources on a pay-as-you-go basis. The term "cloud" in cloud computing is a metaphor for the internet, and the services are often hosted on remote servers that are part of a vast network.

Key Characteristics

  • On-Demand Self-Service: Users can provision and manage computing resources as needed without requiring human intervention from service providers.
  • Broad Network Access: Cloud services are accessible over the internet from a variety of devices such as laptops, smartphones, and tablets.
  • Resource Pooling: Cloud providers pool computing resources to serve multiple customers. Resources are dynamically allocated and reassigned based on demand.
  • Rapid Elasticity: Cloud resources can be quickly scaled up or down to accommodate changes in workload. This flexibility allows users to pay only for the resources they consume.
  • Measured Service: Cloud computing resources are metered, and users are billed based on their usage. This pay-as-you-go model offers cost efficiency and allows for better budget management.

What is AWS EC2?

Amazon EC2, otherwise known as Amazon Elastic Compute Cloud is one of their most well known services. What EC2 allows you to do Amazon provides a secure and resizable compute capacity in the cloud. This simply means that they will provide you with a virtual server/machine that would represent a physical server so that we may be able to deploy our applications. This is a great alternative to acquiring our own hardware and connecting to a network to create our server.

What are the benefits of AWS EC2?

  • Cost-effective: Amazon EC2 allows a pay-as-you-go pricing model, which means you, the user, are in control of the costs on server resources.

  • Moldable: EC2 allows a variety of different instance types (Instance types comprise different combinations of CPU, memory, storage, and network capacity) and operating systems, meaning that it is almost fully customizable to fit your needs.

  • Scalable: EC2 is capable of adjusting computing resources as the website gains or diminishes in demand.

  • Security: EC2 provides different security features such as Virtual Private Cloud, which allows us to safely secure our website and data we receive.

  • Reliable: Because EC2 is under AWS, there is a huge reliability factor, and can reduce the risk of the server having downtime.

What are some issues we may experience when using EC2?

  • Complex: Having to set up and manage EC2 instances may be unfamiliar to us, and users have stated that the documentation isn’t always clear and can be quite confusing to understand.

  • Overhead: There could be a mismanagement of resources and optimization, which can lead to unnecessary costs.

  • Maintenance: There will need to be maintenance to ensure the security of our EC2 instances

What do we receive from the free tier?

With AWS free tier, you are given 750 hours of Linux and Windows t2.micro instances each month for up to one year. To stay within the free tier we must only use EC2 Micro instances.

What is T2 Exactly?

T2 instances in particular are Burstable Performance Instances. This means that they provide a baseline level of CPU performance and have the ability to burst above said baseline. T2 instances can sustain high CPU performance for a long time and for most general-purpose workloads will be sufficient enough without any additional charges. If one would need to run at a higher CPU utilization it could do so but it comes with an additional charge of 5 cents per vCPU-hour. Ability to burst are governed using CPU Credits and increase depending on the instance of T2.

T2.micro comapred with other instances of T2

Instance vCPU CPU Credits / hour Mem (GiB) Storage Network Performance
t2.nano 1 3 0.5 EBS-Only Low
t2.micro 1 6 1 EBS-Only Low to Moderate
t2.small 1 12 2 EBS-Only Low to Moderate
t2.medium 2 24 4 EBS-Only Low to Moderate
t2.large 2 36 8 EBS-Only Low to Moderate
t2.xlarge 4 54 16 EBS-Only Moderate
t2.2xlarge 8 81 32 EBS-Only Moderate

How to setup an EC2 Instance

To setup an EC2 instance you must first create an AWS account or sign into an already existing one.

Once done you will enter the console home, from there you can search up and go to the EC2 page.

image

From there you should now be able be greeted to the EC2 Dashboard where you will lots of information that will be talked about later.

For now you should click Launch Instance (clearly highlighted in the Amazon orange color)

image

On the redirected page, first enter the name of the server, it could be whatever you want, for our project I will use the name SDP32.

image

Next option is to choose an AMI. AMI or Amazon Machine Image is a template that contains a certain software configuration that are commonplace in public use.

image

For the Instance type we will be using t2.micro for the reasons discussed earlier.

image

Next you are going to create a key pair. A key pair is a combination of a public key that is used to encrypt data, and a private key that is used to decrypt the same data.

image

Once you clicked "create a new key pair," give you key pair a name that will be downloaded later. Next you can choose either an RSA or ED25519 algorithm of encyrption. The use of the algorithm depends on your needs. ED25519 keys are much smaller than RSA keys which makes it more efficient authentification time and storage space and is more secure. However, RSA is well established and much more used around the tech world.

For the project I will be using RSA and saving it as a .pem instead of a .ptk file format as we will be using SSH to connect to the instance, not PuTTY.

image

There are multiple different settings for network.

Network: The Virtual Private Cloud (VPC) that you will be using. Subnet: A range of IP addresses in your VPC. Auto IP Adress: Automatically assign a public IP address to the primary network of the instance. Firewall (Security Group): Security group is a set of firewall rules to control traffic to and from the instance. There are Inbound (incoming traffic to instance) rules and Outbound (outgoing traffic from instance). Default API values will be used if nothing is specficed.

I will keep everything defaulted for now.

image

You can then configure the storage, we will be using the default given to us for right now.

image

We can then now launch the instance and we should be sent to this screen and a .pem file should be in your downloads that you will want to keep in a folder for later.

image

Connecting to your instance from Windows using OpenSSH