Resolve Error Configuring Terraform AWS Provider on Windows - DevPops-Inc/windows GitHub Wiki

• The following resolution is for if you receive an error configuring a Terraform AWS provider when trying to run terraform apply on Windows.

• Go to the AWS console in a web browser, expand the profile menu and select “Security credentials.”

• Expand the “Access keys (access key ID and secret access key)” menu and select “Create New Access Key.”

• Select “Download Key File.”

• Select “Save File” and click “OK.”

• Press the Windows key, type “notepad” and select “Open.”

• Expand the “File” menu and select “Open.”

• Browse to the location of the file, expand the file menu and select “All Files.”

• Select the credentials file and select “Open.”

• Highlight the first row and press the “Delete” key twice.

• Highlight terraform,, and press the “Delete” key.

• Press the “Enter” key to move the line down.

• Press the up arrow and type [default].

• Click on the left of the second line and type aws_access_key_id=.

• Click on the right of the first comma, press the “Backspace” and “Enter” keys to bring the access key down one line.

• Click on the left of the third line and type aws_secret_access_key=.

• Scroll to the right, highlight ,https://< AWS number >.signin.aws.amazon.com/console and press the “Backspace” key.

• Expand the “File” menu and select “Save As…”

• Expand the “Local Disk (C:)” and “Users” menus.

• Expand your profile menu and select “.aws” folder. Change the filename to “credentials” in the “File name:” box and select “Save.”

• Close the Notepad application.

• Press the Windows key, type “Git Bash” and select “Open.”

• Type cd < Terraform file directory > and press the “Enter” key to change directory to where the Terraform file is.

• Type ls and press the “Enter” key to sanity check the Terraform file is there.

• Type terraform init and press the “Enter” key to initialize Terraform.

• Type terraform plan and press the “Enter” key to see the plan before going live.

• Type terraform apply and press the “Enter” key to apply the configuration.

• Type yes and press the “Enter” key to confirm.