Home > OS >  Terraform.tfvars file not considered when calling local module in Terraform
Terraform.tfvars file not considered when calling local module in Terraform

Time:10-23

I have parent directory from there i am calling local module ,but Terraform.tfvars file present in parent directory not considered when calling local module .Its taking values from variable file present in local module.

my code is available in GitHub. My code is working fine except that its not considering terraform.tfvars file. Can anyone let me know what is issue in this code ?

https://github.com/sammouse/terraform-code.git

CodePudding user response:

Its taking values from variable file present in local module.

That's how it works. There is no inheritance of variables in TF. You have to explicitly pass all the variables in parent module when to the child module. Otherwise, you have to copy-and-paste all veriables in tfvars in parent module, to tfvars file in child module.

  • Related