Add aws credentials in terraform

github logo Updated on ・1 min read

Create a terraform.tfvars file in your terraform directory

If you give the name as mentioned above, terraform by default recognize that as a local environment file and you do not version control it.

Edit the file add these two variables

aws_access_key = "XXXXXXXXXXX"
aws_secret_key = "XXXX+XXXX"

In this way, you do not have to specifically mention the credentials every time you want to run:

terraform plan
terraform apply

If you create a file with a different name, you can pass the file name while running terraform commands

The above concept is keeping in mind AWS is the default provider and the credentials associated is the default user.

twitter logo DISCUSS
Classic DEV Post from May 19

Don't let that huge codebase scare you! Tips and tools to make sense of other people's code

Parsing through a large, existing codebase can be challenging if you're new to a project. I'll share a few tips and tools for how you can make sense of other people's code without going crazy.

Sree Lasya Vallabhaneni profile image

Customize your DEV feed to keep up with the technologies you care about.

Get Started