tutorials icon indicating copy to clipboard operation
tutorials copied to clipboard

"lcoals" vs "local" - just need more information around it.

Open Mukul-Srivastava opened this issue 2 years ago • 2 comments

Thanks for making it very easy for me to learn how to deploy the AKs using Terraform and how to use workload identity. I am quite new using terraform. I have one little doubt regarding the 0-locals.tf file, where you defined "locals" as a function. but you have used "local" in other TF files, e.g., 2-resource-group, to have reference to "local", not "locals". Can you please let me know why you have not used "locals" instead of "local"?

Mukul-Srivastava avatar Dec 30 '23 14:12 Mukul-Srivastava

It might not be the issue. But the answer would really help to resolve my doubts. Thanks Mukul

Mukul-Srivastava avatar Dec 30 '23 14:12 Mukul-Srivastava

To define variables you use "locals" block. To use variable you use "local.". Here is a reference to official doc - https://developer.hashicorp.com/terraform/language/values/locals#declaring-a-local-value

antonputra avatar Jan 03 '24 19:01 antonputra