Quantcast
Channel: Terraform - HashiCorp Discuss
Viewing all articles
Browse latest Browse all 11395

How to reference root module variable file to child module

$
0
0

Hi Team,

I am new to terraform and i unable to understand some concepts.

Question: How to reference root module variable file to child modules without creating multiple variable.tf file in child module.

currently i am maintaining all_variable.tf file for any variable reference. and i copied to all child modules to work properly but still it’s not working. hence please help me on this.
example:
.
├── modules
│ ├── compute
│ │ ├── all_variable.tf
│ │ └── instance.tf
│ └── network
│ ├── firewall
│ │ ├── firewall.tf
│ │ └── firewall_vars.tf
│ └── vpc
│ ├── all_variable.tf
│ └── vpc.tf
└── setup
├── all_variable.tf
├── main.tf
├── provider.tf
├── terraform.tfstate
└── terraform.tfstate.backup

Thanks in advance.

2 posts - 2 participants

Read full topic


Viewing all articles
Browse latest Browse all 11395

Trending Articles