Setting up an AWS Account

In this lesson, you'll learn how to set up an AWS account to use with Terraform.

Setting up your free AWS account#

Since Amazon changes these pages quite a bit, we’re just going to walk through the general process of what you need to do.

  1. Head over to https://aws.amazon.com
  2. Click on the create Free Tier Account link
  3. Fill in your details
  4. You will need to register a payment card. This is so that if you go over your free tier then Amazon can charge you. Do not worry about this if you follow the examples in this course, nothing should cost any money. Just remember to delete the infrastructure once you have finished with it. Luckily Terraform can do this for you!
  5. We recommend that you turn on 2FA for your newly created AWS log in

Setup an AWS user for use with Terraform#

We now need to create an AWS user that we can use with Terraform. For the purposes of this course, we are going to create an account that has administrator permissions. This is not recommended for a production setup.

  1. Log into your AWS account and go to the IAM section. You can do this by searching for IAM in the search box on the main AWS page and then clicking on the link

  2. Select Users from the left-hand menu

  3. Select Add User at the top

  4. Type in any username you like

  5. For access type, select Programmatic access only

  6. Click Next

  7. On the set permissions screen select Attach existing policies directly

  8. Tick AdministratorAccess which should be at the top of the list

  9. Click Next

  10. Click Next again. You should see a summary of the user you are about to create

  11. Click the Create User button and the user should be created

  12. Store the Access Key Id and Secret Access Key somewhere safe as this is the only time you will see them

Setup an AWS credentials file#

The last thing we need to do is create an AWS Credentials file. This is so that Terraform can get the programmatic credentials for the AWS user we created above. You need to create a file with the following text, replacing the two placeholders with the access key id and secret access key you got from AWS when you created your admin user.

AWS credentials file for Terraform AWS user credentials

Lastly, save the file to the path given in the table below based on your OS:

OS Credentials file path
Windows %UserProfile%/.aws/credentials
Mac OS/Linux ∼/.aws/credentials
Installation
Installing IDE
Mark as Completed
Report an Issue