terraform plan with config path

465 Views Asked by At

I am trying to automate terraform implementation using github actions. Terraform version is 0.11.13

This is my folder structure

.github
- workflows
- account
  - tokyo
    - networking 
      - backend.tfvars
terraform
- networking

I am trying to run terraform init in the networking folder with backend config file in account/tokyo/networking folder.

terraform init --backend-config=/account/tokyo/networking

I also tried

terraform init  --backend-config=/account/tokyo/networking/backend.tfvars

The github actions script runs on ubuntu system and i get the following error for both the above configurations.

terraform init --backend-config='/account/tokyo/networking'

Usage: terraform init [options] [DIR]
.
.
.
Error: Terraform exited with code 1.
Error: Process completed with exit code 1.

What am i missing.

1

There are 1 best solutions below

0
On

Try this command

terraform init --backend-config '/account/tokyo/networking'