简体   繁体   中英

Terraform.tfvars file not considered when calling local module in Terraform

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

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM