How to create an IAM account and configure Terraform to use AWS static credentials?
The first step to launch a Terraform script in Amazon Web Services (AWS) is to configure the Terraform provider.
There are several options to configure the provider for AWS:
- Static credentials
- Environment variables
- Shared credentials file
- EC2 Role
In this article, I’m going to show how to configure the Terraform provider using static credentials.
The Terraform provider looks like this:
provider "aws" {
region = "eu-west-1"
access_key = "my-aws-access-key"
secret_key = "my-aws-secret-key"
}
The process to configure the Terraform provider is divided into 4 steps:
- Generate an IAM user to use with Terraform
Open the AWS Console and type IAM in the search box.
Then, at the IAM dashboard (left side of the screen), select the Users section and then click on the Add User button.