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
0
votes
1 answer

Is there a way to add multiple things into source of google_storage_bucket_object?

The HTML files has a separate css stylesheet and svg images in it that are in different files. resource "google_storage_bucket_object" "index" { name = var.index_page source = var.htmlFile //add more stuff bucket =…
0
votes
1 answer

Terraform - Append a string to an object in a for_each

How do I go about appending the /* to the end of an object using for_each? The goal is to have Terraform to go through the list of resource_arns and add /* to the end. However, I'm currently getting the error, "invalid template interpolation…
0
votes
0 answers

What is the best Terraform solution to apply 2 main.tf files without replicating the common modules twice?

This is my folder format. In services directory directory_A and directory_B can independently be applied. My requirement is to create a main.tf in services and on applying it both directory_A and directory_B should be applied. Common modules should…
0
votes
1 answer

Terraform root module Error: A managed resource "aws_organizations_organizational_unit" "development" has not been declared in the root module

I'm trying to run my terraform scripts and it's throwing the above errors. Project Synopsis: I'm creating an AWS multi-account infrastructure using AWS organizations to create a dev and prod environment. Scripts shown here is only for the…
0
votes
1 answer

"Invalid legacy provider address" using terragrunt

I am hoping someone can help me with an issue I am having with Terraform/Terragrunt. The versions of each that I am currently using are: Terragrunt v0.35.9 Terraform v1.0.11 I am using Terragrunt to deploy project related infrastructure to GCP. I…
0
votes
1 answer

terraform loop with a conditional key inside an object

let's suppose we have this variable: foobars = { "first" : { specialkeys: [ "a", "b", "c" ] } "second" : {} } now let's say we would like to loop over that foobars object knowing that specialkeys…
A Akrm
  • 97
  • 7
0
votes
1 answer

Terragrunt ignores newly added outputs in a project

I've inherited a terraform project set up to deploy to the Elastic Container Service on AWS. So far, I've greatly enjoyed working with it, and have managed to change a few things despite being very new to terraform. Our project uses terragrunt to…
aphenine
  • 1,156
  • 9
  • 18
0
votes
1 answer

How to use managed policy with iam role

I am using terragrunt to call my terraform module.I have one terragrunt.hcl for my dev and another for testing environment.I would like to be able to attach AWS Managed policy(AdministratorAccess) to my Dev account and (AmazonEC2FullAccess) to my…
bibi
  • 285
  • 3
  • 21
0
votes
1 answer

Is there a way with terraform to depend on another terraform git repo?

I have 2 projects (git repo). They each have their own terraform files and state. Now I want these 2 projects to depend on 1 database. I would like to create a common repo with terraform files to create that database and make my 2 initial projects…
bbigras
  • 1,311
  • 2
  • 17
  • 32
0
votes
1 answer

Terragrunt - variables declarations

I have a two directories: in first one I'm keeping modules (basically terraform template configurations) in the second one I'm keeping terragrunt modules implementations. In the second one there is a terragrunt hcl file with inputs inside (one for…
Murakami
  • 3,474
  • 7
  • 35
  • 89
0
votes
1 answer

Terragrunt Multiple Instances Of Module With Varying Fields

I'm having a very hard time trying to understand how to mirror the native Terraform module instantiation structure I am used to in Terragrunt. Take the below Terraform structure that creates different instances of a sns topic module. module…
Howard_Roark
  • 4,088
  • 1
  • 14
  • 24
0
votes
2 answers

Terraform/Terragrunt error if I don't add a default variable

I'm a terraform novice. I've written a module for cloudfront. I want to pass my origin config as an object. When I run terragrunt, I get this error: Error: Invalid default value for variable on variables.tf line 9, in variable…
yossarian2004
  • 299
  • 1
  • 3
  • 11
0
votes
0 answers

Skip terragrunt info output

No matter what terragrunt command I execute, it always starts with the following lines: $ terragrunt show --json outfile 2>/dev/null [INFO] Getting version from tgenv-version-name [INFO] TGENV_VERSION is 0.31.10 $ terragrunt…
pkaramol
  • 16,451
  • 43
  • 149
  • 324
0
votes
0 answers

Terraform aws_security_group: How do you pass ingress and egress blocks from variables?

My main goal is to remove hardcoded ingress and egress configuration blocks from our aws_security_group resources in our terraforms modules. I instead want to pass in one ingress and one egress input variable containing all the ingress and egress…
0
votes
0 answers

Terraform Remote StateFile for multiple instances of same configuration

I have a requirement to create a set of a same number of instances for each of our customers. Let us assume my customers Walmart, Apple, and eBay. Each customer has same number of Instances but configuration(subnet, number of disk and disk sizes, OS…
Eva
  • 515
  • 4
  • 28