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
2
votes
0 answers

Terragrunt local module development

We are looking for a better way to swap out local modules via Terragrunt CLI. Currently engineers must comment out the module source (private git repo) and add a local path reference to their module. This is intrusive for many reasons, and has led…
2
votes
1 answer

Generate file with dynamic content with Terragrunt

I'm really new to Terragrunt. I was wondering if there is a way to dynamically generate the content of a file? For example, consider the following piece of code: generate "provider" { path = "provider.tf" if_exists = "overwrite" …
Rui Jarimba
  • 11,166
  • 11
  • 56
  • 86
2
votes
1 answer

how to get terragrunt to read tfvars files into dependent modules

Anyone know how to get terragrunt to read tfvars files into dependent modules? If I declare all my tfvars as inputs in my root terragrunt.hcl, everything works fine, but of course then I can’t customize them by environment. I tried adding the…
williamcodes
  • 6,317
  • 8
  • 32
  • 55
2
votes
2 answers

Challenges in Configuring terragrunt

I am trying to get the backend.tf created for all sub-folders included in the current project. I have installed terragrunt on my local system $ which terragrunt /usr/local/bin/terragrunt $ terragrunt -version terragrunt version…
Sandy
  • 21
  • 2
2
votes
0 answers

Debugging terragrunt dependency block resulting in s3 permission error

I'm trying to use a dependency block for the first time, but get aws s3 list object permission denied issues and have trouble debugging the issue. The setup is as follows, using an s3 backend for storing terraform state: A git repo containing the…
Tim Kersten
  • 579
  • 3
  • 13
2
votes
1 answer

How to set variables using terragrunt before_hook

I need to use some gcloud commands in order to create a Redis instance on GCP as terraform does not support some options that I need. I'm trying this: terraform { # Before apply, run script. before_hook "create_redis_script" { commands =…
Kaleby Cadorin
  • 179
  • 2
  • 13
2
votes
0 answers

How to use -detailed-exitcode with terragrunt plan?

-detailed-exitcode - Return a detailed exit code when the command exits. When provided, this argument changes the exit codes and their meanings to provide more granular information about what the resulting plan contains: 0 = Succeeded with empty…
Surd
  • 21
  • 3
2
votes
2 answers

how do i do a dynamic route in aws _route_table?

I am using terraform to create my aws route table and its routes. I am referencing base on this: https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/route_table resource "aws_route_table" "r" { vpc_id = aws_vpc.default.id …
shadow
  • 800
  • 2
  • 16
  • 33
2
votes
1 answer

How to make the Terraspace stack common for a few environments?

Please tell me if there is any way to make some Terraspace stack common for a few environments? For example, I have one AWS account for all non-production environments and I'd like to use the same VPC for all environments, all other resources (e.g.…
John
  • 41
  • 2
2
votes
2 answers

Force Terraform to apply pending changes on AWS Elasticache Redis cluster

I am attempting to change the node type of Elasticache from older generation (cache.t2.) to newer generation (cache.t3.) using Terraform. Able to modify the node types successfully for all of Memcached instances via terraform apply, but…
2
votes
2 answers

Terragrunt out to environment variable GitLab CI/CD

I'm trying to run a "Terragrunt plan -out=$PLAN" but it seems I'm unable to? My goal here is to output a plan then show the plan and post to a GitLab merge request. How should I go about accomplishing this? Here is what I have so far: -…
TravelingLex
  • 399
  • 1
  • 3
  • 16
2
votes
3 answers

Tools to easily swap terraform versions

I found the tools tfenv and tfswitch to easily and quickly change the terraform and terragrunt version - and I guess the tools work cause people use it, but for some reason they don't chagne the versions on my computer, after I run let's say $…
potatopotato
  • 1,024
  • 2
  • 16
  • 38
2
votes
3 answers

Terragrunt auto apply

I am trying to run terragrunt with auto-apply for that I've used cli flag --terragrunt-working-dir From the documentation When passed in, don’t show interactive user prompts. This will default the answer for all prompts to ‘yes’ The command…
shamon shamsudeen
  • 5,466
  • 17
  • 64
  • 129
2
votes
1 answer

Unable to properly reference a value from a list within a map

I'm trying to reference a value within a list from a map but can't seem to get terraform to recognize that its a string. Below is my module that I'm working on along with the variable defined. resource "aws_transfer_user" "aws_transfer_users" { …
TravelingLex
  • 399
  • 1
  • 3
  • 16
2
votes
1 answer

Terragrunt: Reading upstream varaibles

I'm trying to work out my AWS infrastructure and have the following structure: regions └── us-east-2_Ohio ├── terragrunt.hcl ├── variables.tf └── vpcs ├── myVPC ├── terragrunt.hcl ├── variables.tf …
Norm
  • 23
  • 3