DEV Community

Cover image for Creating my first EC2 instance on Amazon Web Services (AWS)
Michael Fasani
Michael Fasani

Posted on • Originally published at michaelfasani.com

Creating my first EC2 instance on Amazon Web Services (AWS)

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

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

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.

Amazon Linux 2

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. 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

Can I run Rust on Arm or x86?

Here is a list of Tier 1 operating systems which can run Rust. 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

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, 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

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

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
Enter fullscreen mode Exit fullscreen mode

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.

Top comments (0)