terragruntArchived
7 messages
Terragrunt discussions
Archive: https://archive.sweetops.com/terragrunt/
Jaesonalmost 5 years ago(edited)
Hi. Iβm trying to figure out how to use variables merged from tfvar files in my βrootβ terragrunt.hcl file. Given this region.tfvar file:
How do I access pass
region_parameters = {
region = "us-west-1"
}How do I access pass
region above to this terragrunt.hcl (in the same directory)?:terraform {
extra_arguments "common_vars" {
commands = get_terraform_commands_that_need_vars()
required_var_files = [
find_in_parent_folders("common.tfvars"),
]
optional_var_files = [
find_in_parent_folders("account.tfvars"),
find_in_parent_folders("regional.tfvars"),
find_in_parent_folders("env.tfvars")
]
}
extra_arguments "disable_input" {
commands = get_terraform_commands_that_need_input()
arguments = ["-input=false"]
}
}
remote_state {
backend = "s3"
config = {
bucket = "compeat-dev-terraform"
key = "us-west-1/${path_relative_to_include()}/terraform.tfstate"
# for example, I want to use it here:
region = "us-west-1"
}
}Mr.Devopsalmost 5 years ago
i'm running into the following error when running terragrunt with azure provider. Has anyone come across this? Seems a possible bug i may have encountered?
I'm running tf version
I'm running tf version
0.14.9 and tg version 0.28.20azurerm_role_definition.default: Creating...
Error: rpc error: code = Unavailable desc = transport is closing....
2021/04/12 19:38:12 [TRACE] dag/walk: upstream of "provider[\"<http://registry.terraform.io/hashicorp/azurerm\|registry.terraform.io/hashicorp/azurerm\>"] (close)" errored, so skipping
2021/04/12 19:38:12 [TRACE] dag/walk: upstream of "root" errored, so skipping
2021-04-12T19:38:12.459-0700 [DEBUG] plugin: plugin exited
!!!!!!!!!!!!!!!!!!!!!!!!!!! TERRAFORM CRASH !!!!!!!!!!!!!!!!!!!!!!!!!!!!
Terraform crashed! This is always indicative of a bug within Terraform.
A crash log has been placed at "crash.log" relative to your current
working directory. It would be immensely helpful if you could please
report the crash with Terraform[1] so that we can fix this.
When reporting bugs, please include your terraform version. That
information is available on the first line of crash.log. You can also
get it by running 'terraform --version' on the command line.
SECURITY WARNING: the "crash.log" file that was created may contain
sensitive information that must be redacted before it is safe to share
on the issue tracker.
[1]: <https://github.com/hashicorp/terraform/issues>
!!!!!!!!!!!!!!!!!!!!!!!!!!! TERRAFORM CRASH !!!!!!!!!!!!!!!!!!!!!!!!!!!!
ERRO[0079] Hit multiple errors:
Hit multiple errors:
exit status 1 sheldonhalmost 5 years ago(edited)
Avoided terragrunt for a long time, stuck with Terraform Cloud at last role, not for flexibility but for simplicity in team collaboration.
I'm now at a new role where that's not as much of a concern, and instead I want flexibility to not require lots of repeated var configurations for multiple environments. I tend to avoid workspaces (terraform native ones) and prefer folder/var driven instead.
What I've Tried
- I tried yaml config approach that cloudposse wrote, which is very creative, but in the end felt it was a bit hard to debug for my use case. I also don't need to support k8s, just terraform + Go apps. This has made me tempted to use pulumi π
- I started writing my own Taskflow (Go automation wrapper) and realized I'm probably implementing what Terragrunt does with much less elegance. π
My Environment
- I have to use Azure Repos (no more github access)
- I need to deploy multiple clones of the environments to help with staging and so on.
- I'm familiar with Go, and working with Go developers.
- Considering for Azure Repos: Atlantis + terragrunt over building azure pipelines to handle the workflow.
- Also considering astro which seemed pretty cool as well. https://github.com/uber/astro
Is there any caution or advice against terragrunt being a good solution to simply this?
I'm now at a new role where that's not as much of a concern, and instead I want flexibility to not require lots of repeated var configurations for multiple environments. I tend to avoid workspaces (terraform native ones) and prefer folder/var driven instead.
What I've Tried
- I tried yaml config approach that cloudposse wrote, which is very creative, but in the end felt it was a bit hard to debug for my use case. I also don't need to support k8s, just terraform + Go apps. This has made me tempted to use pulumi π
- I started writing my own Taskflow (Go automation wrapper) and realized I'm probably implementing what Terragrunt does with much less elegance. π
taskflow -v tidy job-tfact "action=plan" "env=dev.staging" "stack=ecs_task_name" is basically a less featured version of what terragrunt does πMy Environment
- I have to use Azure Repos (no more github access)
- I need to deploy multiple clones of the environments to help with staging and so on.
- I'm familiar with Go, and working with Go developers.
- Considering for Azure Repos: Atlantis + terragrunt over building azure pipelines to handle the workflow.
- Also considering astro which seemed pretty cool as well. https://github.com/uber/astro
Is there any caution or advice against terragrunt being a good solution to simply this?
M
managedkaosalmost 5 years ago
@sheldonh are you using Azure DevOps pipelines? I have had success using a release pipeline with workspaces to stamp out multiple copies of an environment with no code changes. The state is in Azure Storage and variables in the pipeline set up the workspaces for me.
M
managedkaosalmost 5 years ago
managedkaosalmost 5 years ago
I know this is the #terragrunt channel, so apologies that this is not terragrunt specific but i followed the conversation here from #terraform. π
Also, yes, this is a UI implementation of a pipeline vs a YAML based pipeline. However, I export the pipeline as JSON for backup.
Anyway, it works pretty good! π€·ββοΈπΎ
Also, yes, this is a UI implementation of a pipeline vs a YAML based pipeline. However, I export the pipeline as JSON for backup.
Anyway, it works pretty good! π€·ββοΈπΎ
sheldonhalmost 5 years ago
Would love any help i could get on this as I'm running into a few issues maybe easier to deal with if you know terragrunt well.
https://github.com/antonbabenko/terragrunt-reference-architecture/issues/8
https://github.com/antonbabenko/terragrunt-reference-architecture/issues/8