Create a free AWS account and configure the AWS CLI
Tags: aws, beginners, tutorial, devops
Published: 2022-12-08 14:47:10

## What is AWS?
AWS stands for Amazon Web Services, which is a cloud computing services platform offered by Amazon. [AWS](https://www.czerniga.it/category/aws_en/) enables a wide range of computing services, such as data storage, computing, databases, web applications, etc. With AWS, you can easily and flexibly scale your applications and services, and manage them from anywhere in the world through a user-friendly web interface. AWS is one of the most popular cloud computing platforms and is used by many companies around the world.

AWS offers a free version of its platform, which is called AWS Free Tier. The free version of AWS allows you to use selected services within certain limits at no additional cost. For example, you can enjoy free cloud storage, free computing or free database for a certain period of time. After that time, you can continue using the services, but you will have to pay for their use. The free version of AWS is ideal for people who want to try out the platform or use it in a small way.

It is important to note here that when creating an account, you will be required to provide a payment card number that can be used to pay online. Consequently, if you exceed any limits you will be charged with the cost of this very card. Therefore, it is a good idea to control the costs here on a regular basis. You can read more on Wojciech Lepczynski's blog: @wlepczynski https://lepczynski.it/en/aws_en/how-to-control-costs-in-the-aws-cloud/

## Create a free AWS account

### step 1

We start creating an account by going to https://portal.aws.amazon.com/billing/signup?refid=em_127222&redirect_url=https%3A%2F%2Faws.amazon.com%2Fregistration-confirmation#/start/email

![Sign up for AWS](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/zews6vaireske8yee1wi.png)

On this page, we enter our email address and AWS account name. The account name is not that important. You can change it after logging into the account.

### step 2

Now we need to confirm our email address by entering the verification code that we will receive in an email from AWS. 

![Email verification](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/o6ljlcepj7j3zcqg326q.png)

### step 3

After confirming the address, we proceed to enter our password for the root account.

![Aws root password](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/7u8eyhcxdft66i77mtey.png)

### step 4

In the next step we need to enter our data. Here we need to provide real data. This is because they will be needed to verify the card and phone number.

![Mobile phone verification](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/do2vjvk7hhy5ff1t2g65.png)

### step 5

In the next step, we need to provide our payment/credit card details.

![Payment/credit card verification](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/rzns0053jjpr4krzuiq9.png)

Here there will also be a need to confirm the withdrawal of 1 dollar from the account. This money will come back after verification from AWS website.

### step 6

Now we need to confirm our phone number. To do this, we need to select the type of verification. The easiest way to do this is by choosing to send a code via SMS.

![Text Message verification](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/msmo68vmcb5nlneq7chz.png)

### step 7

In the last step, we choose the type of support from AWS. Here we choose **Basic support Free** option.

![Select a support plan](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/pjbtixycsblujdd0wol2.png)

### Congratulations !!!

We have reached the last step. The account has been created, but we still have to wait a while for it to be activated. We will receive information about this by email.

![Congratulations - AWS account is ready](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/84y67jzvdc10bn0jpidz.png)

After logging in, we will see the main AWS console panel.

![Main AWS console panel](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ykz4htb5tka81ifjmzta.png)

## Creating a technical user

After creating the account, we operate as a root user. However, it is advisable to work with the account in the console from a user with lower privileges. Therefore, it is recommended to create such a user and use it in interacting with the account.

### step 1

We now go to our portal and type **IAM** in the search panel. After a while, we will see a link to a page related to user management.

![IAM control panel](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/2oqry76hq8bg6uma9vcl.png)

### step 2

On the next page, we select **Users** from the menu and then click on **Add User**.

![Let's create user](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/bgpgz92pf0qup7n0ql60.png)

### step 3

Now we need to enter the name of our user and select **Access key - Programmatic access**. This will create a user that we will connect to from the AWS CLI. We now click on Next:Permissions.

![AWS user details](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/21s4g18ngpbjkeiplq8m.png)

### step 4

In the next step, we need to assign permissions for our user. To do this, we select **Attach exisiting policies directly**. Then, in the search window, we specify **AmazonS3FullAccess**. This will allow the user to fully manage S3 buckets. If you want you can give more permissions here.

![Permissions for new user](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/q03f1m3lfhyccjdq752r.png)

### step 5

In the next step, we assign tags for our account. We can skip this step and go to the next step - summary.

### step 6

Now we can check the summary about our user. We create a user by clicking on **Create user**. 

![Review new user settings](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/l6n1ll9a31ntuxq256iv.png)

### step 7

On the last page of user creation, a very important piece of information appears. These are the two keys **Access key ID** and **Secret access key**. Copy them because you will need them during AWS CLI configuration.

![AWS CLI keys](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/p8lgwbq8fiohlqel8lki.png)

## AWS CLI configuration

Amazon provides a very good AWS CLI tool that allows you to manage resources from the console. Below I show how to configure the Linux console. If you want to use other consoles (Windows or, for example, Mac) take a look at the official AWS website: https://docs.aws.amazon.com/cli/latest/userguide/getting-started-install.html

### step 1

The first step is to install the AWS CLI tool. The quickest way to do this is by running the following script:

``` bash
curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "awscliv2.zip"
unzip awscliv2.zip
sudo ./aws/install
```

After installing the tool, we can verify that it is working properly by running the command:

``` bash
> aws --version
aws-cli/2.1.10 Python/3.7.3 Linux/5.10.102.1-microsoft-standard-WSL2 exe/x86_64.ubuntu.20 prompt/off
```

### step 2

Now we need to configure our tool to be able to communicate with our account. To do this, we need to run the command:

``` bash
> aws configure
AWS Access Key ID [None]: **[KEY_ID]**.
AWS Secret Access Key [None]: **[Access Key]**.
Default Region Name [None]: **[region]**.
Default output format [None]: json
```

In the place of **[KEY_ID]** and **[Access Key]**, we need to specify our id and the key generated when creating the user. In addition, in **[region]** we specify the default region.

### step 3

After configuring the tool, we can check if we are able to connect to our account. To do this, we can run a sample command that will create a sample S3 bucket. The name of the bucket must be unique

``` bash
> aws s3api create-bucket --bucket bucket-20221206 --region us-east-1
{
    "Location": "/bucket-20221206"
}
```
Now we can display the list of buckets:
``` bash
> aws s3 ls
2022-12-06 15:29:29 bucket-20221206
```
It's worth deleting this bucket at the end:
``` bash
> aws s3api delete-bucket --bucket bucket-20221206 --region us-east-1
```

## Summary

As I've shown in this tutorial, creating a free AWS account is simple and requires only registration on Amazon's website. Configuring the AWS CLI console is also not complicated and requires only a few minutes.

Once you have configured the above tools, you can already start working with AWS using Infrastructure as code tools like [Terraform](https://www.czerniga.it/category/terraform_en/). Which I sincerely encourage you to do!