Creating my first EC2 instance on Amazon Web Services (AWS)
Tags: aws, rust
Published: 2023-05-27 11:40:59

## TL;DR 

Today I learned Amazon make their own CPU's and have a version of Linux, both were designed to offer a better cloud experience when working with AWS. I set up my own AWS EC2 instance, and soon, I will install Rust and write my first Rust application. Follow me to learn more as I continue on this journey.

- [My AWS Plan](#my-aws-plan)
- [A noob with questions...](#a-noob-with-questions)
- [What operating system should I choose, RedHat vs SUSE Linux vs Amazon Linux 2?](#what-operating-system-should-i-choose-redhat-vs-suse-linux-vs-amazon-linux-2)
- [What is the difference between 64-bit (x86) 64-bit (Arm)?](#what-is-the-difference-between-64-bit-x86-64-bit-arm)
- [Can I run Rust on Arm or x86?](#can-i-run-rust-on-arm-or-x86)
- [What is the difference between a 32-bit or a 64-bit operating system?](#what-is-the-difference-between-a-32-bit-or-a-64-bit-operating-system)
- [Setting up my AWS EC2 server](#setting-up-my-aws-ec2-server)
- [What's next...](#whats-next)

## My AWS Plan

I plan to start working with Rust in the cloud and in the browser using WebAssembley. As a Senior Frontend Developer who spent the last 10 years focusing on JavaScript I know almost nothing about hosting my own servers. I maintained a couple of servers over 15 years ago, which ran Internet Information Services (IIS) on Windows.

I think having experience with AWS will be a valuable skill to have. With the Amazon free tier, you get 12 months of free AWS products to play with and having a playground of unlimited computing power, and modern infrastructure could be very interesting. That is one of the reasons why I am jumping into AWS and documenting my learning process.

## A noob with questions...

As I know, almost zero about cloud computing I had to Google a few questions along the way, and below, I have documented my learning process and decisions.

After signing up to AWS and AWS Training, I watched some videos and signed up to this course on Udemy: [Free AWS Certified Cloud Practitioner 2019](https://www.udemy.com/course/free-aws-certified-cloud-practitioner)

Next, I started to set up my own EC2 instance. You have to select software and hardware options, and as I am cloud computing noob, I had some questions.

## What operating system should I choose, RedHat vs SUSE Linux vs Amazon Linux 2?

Turns out Amazon have their own version of Linux, in a nutshell: Amazon Linux 2 includes support for the latest Amazon EC2 instance capabilities and is tuned for enhanced performance. It contains packages that help ease integration with other AWS Services. Sounds good to me! I decided to go with [Amazon Linux 2](https://aws.amazon.com/amazon-linux-2).

![Amazon Linux 2](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/3261v4d0t72uoxngchi8.png)

## What is the difference between 64-bit (x86) 64-bit (Arm)?

Amazon is making its own Arm chips that [should provide better performance when using AWS](https://www.youtube.com/watch?v=KLz8gC235i8). I decided to go with an Arm chip, but this was a mistake as it turns out for the free tier option you have to choose x86.

![AWS T2 Micro](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/o3r4hp74pn85f1ujmkmw.png)

## Can I run Rust on Arm or x86?

Here is a list of [Tier 1 operating systems which can run Rust](https://forge.rust-lang.org/release/platform-support.html). Based on this list it seems I can run Rust on any Linux OS in either 32-bit or 64-bit.

![Rust Tier 1 platforms](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/zywl5la559kb30bql114.png)

## What is the difference between a 32-bit or a 64-bit operating system?

Simply put, a [64-bit processor is more capable than a 32-bit processor](https://www.digitaltrends.com/computing/32-bit-vs-64-bit-operating-systems/), because it can handle more data at once. Here's the key difference: 32-bit processors are capable of handling a limited amount of RAM (in Windows, 4GB or less), and 64-bit processors are capable of utilizing much more.

## Setting up my AWS EC2 server

I followed this video for the most part to setup my AWS EC2 server: [AWS Training - Introduction to EC2](https://www.aws.training/Details/Video?id=16382)

After setup, I was able to login using the AWS online SSH console.
After logging in, I was told there were four security updates and to run `sudo yum update`.

![AWS online SSH console](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/xopk62iesvpnuzmfzqgc.png)

Next, I tried to use my SSH *.pem key to log in, which was also a success but I just had to CHMOD the key first, but all of this information was in AWS under the connect option.

```
chmod 400 my-key-pair.pem
ssh -i my-key-pair.pem my-instance-user-name@my-instance-public-dns-name
```

I will need to rewatch some of the information from the free Udemy course above to make sure I have set things up in the correct way, for now, I have terminated the server. I will probably set up another one in the same way once I feel happy with the choices I have made and what I have learned today.

## What's next...

In my next post on my AWS journey, I will try to install Rust and make a small Rust application, then I plan and then talk to my Rust application over HTTP using JavaScript.