Questions tagged [terragrunt]

Terragrunt is a thin wrapper for Terraform that provides extra tools for working with multiple Terraform modules.

Terragrunt is a thin wrapper for Terraform that provides extra tools for keeping your Terraform configurations DRY, working with multiple Terraform modules, and managing remote state.

Check out the terragrunt-infrastructure-modules-example and terragrunt-infrastructure-live-example repos for fully-working sample code that demonstrates this new folder structure.

284 questions
5
votes
1 answer

aws_security_group - conditional ingress

I'm testing Terraform/Terragrunt to deploy RDS DB to AWS. Is there a way to add conditional ingress to the aws_security_group definitions? Terraform v0.12.3 Terragrunt version v0.19.8 As now the best I was able to do was add one security group for…
4
votes
1 answer

Terraform: remote module not following providers block - Warning: Reference to undefined provider

I'm trying to use a (private) remote terraform module, and trying to pass a different provider to it. For the remote module, there are no providers defined and to my understanding, it will use a the local provider instead. I can't seem to be able to…
4
votes
2 answers

How can I use locals defined in terragrunt.hcl in Terraform files?

I've created this folder structure: . ├── main.tf └── terragrunt.hcl # FILE: terragrunt.hcl include { path = find_in_parent_folders() } locals { common_vars = read_terragrunt_config(find_in_parent_folders("common.hcl")) cluster_name =…
Vitor Falcão
  • 1,007
  • 1
  • 7
  • 18
4
votes
0 answers

How to force Terragrunt fail on first error during run-all apply execution

Currently when I ran terragrunt run-all apply agaings folder execution continues even if errors apppears, this cause errors in other modules so I end up with huge log output and have to search accross it for first incident. Is there are any way to…
Andriy Kopachevskyy
  • 7,276
  • 10
  • 47
  • 56
4
votes
0 answers

terragrunt plan failing with timeout while waiting for plugin to start

I have ran terragrunt init and it went successfully & downloaded required providers but while running terragrunt plan it hung with below errors and crashes my computer. While I'm trying to update an IAM role getting this error. terragrunt…
4
votes
1 answer

Terraform Cognito User Pool can't run update

Im trying to use Terraform to deploy a AWS Cognito User Pool. Everything runs fine on first deploy, but when i try to run a terraform apply-all for a second time without modifying anything on my config, i get: Error: error updating Cognito User Pool…
4
votes
4 answers

Seeing "The filename or extension is too long" when "terragrunt plan" is executed in Windows

Executing "terragrunt plan" from Visual Studio code gives the below error in Windows 10: Running command: terraform init -backend-config=region=eu-west-2 -backend-config=bucket=bucket-name" -backend-config=dynamodb_table=lock-table…
Vamshee Akula
  • 41
  • 1
  • 2
4
votes
0 answers

How to import to module using terragrunt?

So I'm having a hard time trying to import into module when using a third-party module via terragrunt. My terragrunt.hcl file is as follows locals { environment_vars = read_terragrunt_config(find_in_parent_folders("env.hcl")) env =…
4
votes
2 answers

How To Have Terragrunt Auto Set "AWS_PROFILE" environment variable?

I cannot for the life of me get this to work. I need to have the AWS_PROFILE environment variable set to get terragrunt to run properly. If I run: export AWS_PROFILE=myprofile; terragrunt plan That will work, but that's not what I'm after I want to…
wesleywh
  • 1,053
  • 1
  • 13
  • 30
4
votes
1 answer

Take ECS Task Definition environment variables from Terraform input variables

I am trying to deploy ECS task definition with Terraform. Here is my ECS task definition resource code: resource "aws_ecs_task_definition" "my_TD" { family = "my_container" container_definitions = <
4
votes
1 answer

Terragrunt path resolution - locally referenced modules - splitting into multiple environments

For business-related reasons, I am not able to split my infrastructure using versioned modules. As it is still beneficial to split the environments, and I would like to avoid the copy/paste root modules, which are basically just instantiation of…
Alan Kis
  • 1,790
  • 4
  • 24
  • 47
4
votes
3 answers

Terragrunt and common variables

I'm trying to something fairly simple, but can't seem to get my head around it. I have the following structure: - terragrunt.hcl -----dummy/ ---------main.tf ---------terragrunt.hcl I'm looking to set some common variables at the root level, and…
ashic
  • 6,367
  • 5
  • 33
  • 54
4
votes
1 answer

Create multiple objects from one Terraform module using Terragrunt

I am using terraform via terragrunt. I have a folder with a single terragrunt.hcl file in it. The purpose of this file is to create multiple subnetworks in GCP. To create a subnetwork, I have a module that takes several inputs. I want to be able to…
Johnathan
  • 737
  • 2
  • 7
  • 21
3
votes
0 answers

How to include directories with Terragrunt

Is there a way to copy directories into the Terragrunt workspace? I've come across the include_in_copy attritube, and I've tried something like this terraform { source = "git@gitlab.foo" include_in_copy = [ …
Metro
  • 873
  • 8
  • 19
3
votes
1 answer

How to use Terragrunt in Github Actions

I am relatively new with creating custom github action workflows. I am trying to utilize Terragrunt with Terraform to automate my CICD workflow using Github Actions which provisions resources in a GCP account. I have gotten a Terraform Github…
1
2
3
18 19