DEV Community πŸ‘©β€πŸ’»πŸ‘¨β€πŸ’»

Cover image for Create a free AWS account and configure the AWS CLI

Create a free AWS account and configure the AWS CLI

What is AWS?

AWS stands for Amazon Web Services, which is a cloud computing services platform offered by Amazon. AWS 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

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

step 3

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

Aws root password

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

step 5

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

Payment/credit card verification

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

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

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

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

Main AWS console panel

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

step 2

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

Let's create user

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

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

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

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

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:

curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "awscliv2.zip"
unzip awscliv2.zip
sudo ./aws/install
Enter fullscreen mode Exit fullscreen mode

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

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

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:

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

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

> aws s3api create-bucket --bucket bucket-20221206 --region us-east-1
{
    "Location": "/bucket-20221206"
}
Enter fullscreen mode Exit fullscreen mode

Now we can display the list of buckets:

> aws s3 ls
2022-12-06 15:29:29 bucket-20221206
Enter fullscreen mode Exit fullscreen mode

It's worth deleting this bucket at the end:

> aws s3api delete-bucket --bucket bucket-20221206 --region us-east-1
Enter fullscreen mode Exit fullscreen mode

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. Which I sincerely encourage you to do!

Top comments (0)

Layoffs: It’s Okay to Not Be Okay