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.
- Head over to https://aws.amazon.com
- Click on the create Free Tier Account link
- Fill in your details
- 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!
- 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.
-
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 -
Select Users from the left-hand menu
-
Select Add User at the top
-
Type in any username you like
-
For access type, select
Programmatic access
only -
Click Next
-
On the set permissions screen select
Attach existing policies directly
-
Tick
AdministratorAccess
which should be at the top of the list -
Click Next
-
Click Next again. You should see a summary of the user you are about to create
-
Click the Create User button and the user should be created
-
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.
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 |