You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've been using Terragrunt for a long-time but am stumped as to the best way to implement multi-cloud infrastructure. I want to use AWS and Azure, and the logical layout looks something like:
I'll share some code because I think it will help you understand what I'm trying to do, even though the code doesn't work right now as either I fall into multiple includes or I can't access variables that I think I should be able to access.
terragrunt.hcl - I tried to put the generic stuff here that everything uses
aws/providers.hcl - Here we see something that I think could be an antipattern in naming. In a past life I had GCP and AWS in a Terra config but the actual infra was only in AWS, I used gcp_region and aws_region to differentiate. In the setup below, should I just call it region whichever cloud provider it is and let the directory context determine the intention? Look at the bottom of this file; if I called it region instead of aws_region, perhaps that could move to the top level terraform.hcl?
ERRO[0000] Not all locals could be evaluated:
ERRO[0000] - azure_region [REASON: Can't evaluate expression at /redacted/azure/providers.hcl:7,29-66 because local reference 'region_vars' is not evaluated. Either it is not ready yet in the current pass, or there was an error evaluating it in an earlier stage.]
I can see why. Because region_vars is supposed to be generic and defined in the top-level terragrunt.hcl. But if I add:
include "root" {
path = "${get_path_to_repo_root()}/terragrunt.hcl"
}
to azure/providers.hcl I get Only one level of includes is allowed.
If I add the same include to ./azure/main/eastus/production/some_app/terragrunt.hcl so that it contains:
include "root" {
path = "${get_path_to_repo_root()}/terragrunt.hcl"
}
include "providers" {
path = find_in_parent_folders("providers.hcl")
}
I get the same error about azure/providers.hcl failing on line 7.
Grateful for any assistance. I'm sure that both my architecture and my understanding of Terragrunt's behaviour could be improved.
The text was updated successfully, but these errors were encountered:
Hi all,
I've been using Terragrunt for a long-time but am stumped as to the best way to implement multi-cloud infrastructure. I want to use AWS and Azure, and the logical layout looks something like:
I've tried to be semi-inspired by https://github.com/iancoralogix/multi-cloud-terragrunt-filesystem but I'm not sure if that's the right approach. The files there include
providers.hcl
but nothing seems to include the rootterragrunt.hcl
.I'll share some code because I think it will help you understand what I'm trying to do, even though the code doesn't work right now as either I fall into multiple includes or I can't access variables that I think I should be able to access.
terragrunt.hcl
- I tried to put the generic stuff here that everything usesaws/providers.hcl
- Here we see something that I think could be an antipattern in naming. In a past life I had GCP and AWS in a Terra config but the actual infra was only in AWS, I usedgcp_region
andaws_region
to differentiate. In the setup below, should I just call itregion
whichever cloud provider it is and let the directory context determine the intention? Look at the bottom of this file; if I called itregion
instead ofaws_region
, perhaps that could move to the top levelterraform.hcl
?azure/providers.hcl
- Same here, shouldazure_region
even be a thing or justregion
? Should I refer tosubscription
asaccount
as in AWS?Lastly for now,
./azure/main/eastus/production/some_app/terragrunt.hcl
:My current error is:
I can see why. Because
region_vars
is supposed to be generic and defined in the top-levelterragrunt.hcl
. But if I add:to
azure/providers.hcl
I getOnly one level of includes is allowed.
If I add the same
include
to./azure/main/eastus/production/some_app/terragrunt.hcl
so that it contains:I get the same error about
azure/providers.hcl
failing on line 7.Grateful for any assistance. I'm sure that both my architecture and my understanding of Terragrunt's behaviour could be improved.
The text was updated successfully, but these errors were encountered: