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

accessing variable in terragrunt that is in terraform.tfvars

I have this terraform.tfvars file in the following location: root |_prod |_eu-west-2 |_dev |_terraform.tfvars |_cognito |_terragrunt.hcl it has these values: terragrunt = { terraform { extra_arguments "custom_vars"…
dagda1
  • 26,856
  • 59
  • 237
  • 450
2
votes
2 answers

Is Terragrunt available for Azure?

I want to manage multiple environments with difference in instance size and instance cost. Can we use Terragrunt used for that purpose. Also is Terragrunt used in Azure?
SiddhiMorajkar
  • 395
  • 4
  • 7
  • 18
2
votes
1 answer

Terraform variable list of key value pairs for environment variables of batch job

I've specified a batch job as: resource "aws_batch_job_definition" "batch_job" { name = "${var.name}" type = "container" container_properties = <
Chloe
  • 21
  • 1
  • 1
  • 2
2
votes
1 answer

Target a single terraform module and its dependencies using terragrunt

Terragrunt allows us to execute terraform commands on multiple modules at once ([1]). However sometimes we want to target a single module and its dependencies in order to create and apply a plan for those modules only. This would look…
Miguel Ferreira
  • 1,282
  • 11
  • 27
2
votes
0 answers

terragrunt with shared infrastrucure between platforms

directory structure I am using s3 as remote state backend and dynamodb table for locking Both platform1 and platform2 used share infrastructure from shared platform If I try to create platform1 first it will fail as the dependencies in shared…
testuser
  • 33
  • 4
2
votes
1 answer

Terragrunt v0.14.9, Terraform v0.11.7 reading AWS VPC ID from second environment

I have used Terragrunt to orchestrate the creation of a non-default AWS VPC. I've got S3/DynamoDB state mgmt, and the VPC code is a module. I have the 'VPC environment' terraform.tfvars code checked into a second repo as per the terragrunt…
volvox
  • 3,014
  • 16
  • 51
  • 80
2
votes
1 answer

why terragrunt destroy previous created resources

i organized our terraform code as below: $ tree infrastructure infrastructure ├── ecr │   └── terraform.tfvars ├── ecs │   ├── ecs-iam.json │   └── terraform.tfvars └── terraform.tfvars 2 directories, 4 files …
roadtest ma
  • 103
  • 7
1
vote
0 answers

Terragrunt InvalidUserData.Malformed: Invalid BASE64 encoding of user data

I would like to use EOF in the user_data field of the autoscaling terraform module. Example: user_data = <<-EOT #!/bin/bash cat <<'EOF' >>…
S1c0r4x
  • 47
  • 2
  • 6
1
vote
0 answers

Dynamically execute dependency blocks in terragrunt with for_each (or similar)

I'm trying to DRY/parametrize the dependency block of my terragrunt file for my multi-environments setup. I've these dependencies: dependency "development" { config_path = "../../development/mandatory_resources" } dependency "production" { …
Gabriele B
  • 2,665
  • 1
  • 25
  • 40
1
vote
0 answers

Enable/disable a module that configure a provider

I'm trying to conditionally create a module, which require some providers (kubernetes,helm,kubectl) that are configured based on it outputs and I'm facing some issues. for example, lets say I have a module (its name is main) which “calls” other…
1
vote
1 answer

Terraform AWS GovCloud Error: configuring Terraform AWS Provider, api error InvalidClientTokenId: security token invalid

Problem I am trying to deploy some stuff to govcloud, and am having a heck of a time getting this to deploy. The code has successfully deployed to the commercial aws infrastructure without issue. But throws an error about the…
aRustyDev
  • 101
  • 1
  • 11
1
vote
0 answers

Issue with importing aws_iam_role_policy

I have used terragrunt to manage my infrastructure. I am trying to import the inline policy attached with IAM role but its keep giving me the error below Import command used: terragrunt import aws_iam_role_policy.aws_load_balancer_controller…
1
vote
0 answers

What is the correct form of terragrunt terraform source to get module from private gitlab terraform registry

Could you kindly help me with my issue? I have terraform module on private gitlab instance and I can obtain it with http-source from terragrunt like this: terraform { source =…
1
vote
1 answer

Terraform: Nested for expression with no duplicity

I am newbie to Terraform, apologies in advance in case inappropriate logic is used. There is nested map, want to create new map using existing one. terraform.tfvars vpcs_info= { "devops" = { main = { cidr = "10.14.0.0/16" region =…
1
vote
3 answers

Using terraform's for_each with data that doesn't have a unique key

When using terraform's for_each you have to specify a unique id to be used as a way to link the generated recource with its source definition. I'd like to use a natural index for this, rather than an arbitrary unique value. In this case I'm working…
JohnLBevan
  • 22,735
  • 13
  • 96
  • 178