Questions tagged [terragrunt]
Terragrunt is a thin wrapper for Terraform that provides extra tools for working with multiple Terraform modules.
189
questions
0
votes
1
answer
14
views
Adding a Lambda function into Kinesis Firehose via Terraform
I have a firehose delivery stream storing data in S3. However, I want to add a lambda function to the delivery stream to parse data before storage.
Do I need an IAM policy in addition to kinesis ...
0
votes
0
answers
21
views
Terraform container - /usr/bin/git exited with 128: fatal: unsafe repository ('/path' is owned by someone else) when checking out registry modules
I am trying to checkout registry modules with terraform.
I am using a terragrunt container and getting the following error when I use a module that is pulling from github.
/usr/bin/git exited with ...
0
votes
1
answer
25
views
Variables in terragrunt. AWS region selection
I'm trying to create AWS environment using terragrunt. I worked in us-east-2 region and now I want to work in eu-central-1.
In my code I have the only variable, that represents region. I changed ...
0
votes
1
answer
36
views
grant privileges and permissions to a role via terrafrom is not working
according to terraform doc, I created a user and role as follows:
resource "postgresql_role" "ro_role" {
name = "ro_role"
}
resource "postgresql_role" &...
0
votes
0
answers
23
views
Running terragrunt in debug mode generates empty terragrunt-debug.tfvars.json
I'm trying to generate the terragrunt-debug.tfvars.json file as described in the Debugging Terragrunt page.
I can see that the file is generated when running terragrunt plan... command:
Debug mode ...
0
votes
0
answers
22
views
Export file from ansible playbook as a terraform / terragrunt output
I am new to ansible and I am trying to adapt a terrraform-ansible setup for installing kubernetes to be used dynamically with terragrunt
I have an ansible playbook that installs the kubernetes control ...
-2
votes
0
answers
9
views
What does ERRO[0220] mean
What does the following error mean - ERRO[0020] <dependency/terragrunt.hcl> is a dependency of <dependent/terragrunt.hcl> but detected no outputs. Either the target module has not been ...
0
votes
0
answers
26
views
How to include file from terraform source module in terragrunt?
I have two repos, one contains terragrunt configuration and the other contains terraform code. I would like to include a file in terragrunt configuration that is present in terraform code.
I guess ...
0
votes
0
answers
45
views
Missing required GCS remote state configuration location
After Google Cloud quota update, I can't run terragrunt/terraform code due to strange error. Same code worked before with other project on same account. After I tried to recreate project (to get new ...
0
votes
1
answer
25
views
Terragrunt import with no root main.tf?
I want to run terragrunt import on an external module. (This resource exists in the real world and I want to pull it into my state).
# terragrunt.hcl
terraform {
source = "../../../../..//...
0
votes
1
answer
25
views
Terraform / Terragrunt use variables for provider_version
I am looking to pass in the provider_version into terragrunt.hcl as a variable to make upgrading / setting the version easier. However this is my current code:
terraform {
backend "s3" {}
...
0
votes
0
answers
13
views
file not found,jenkins pipline
I am getting file not found error on my Jenkins job.
if (component_meta ==null)
echo "path = " + component_meta
else if (component_meta.tf_version !=null){
echo "path = &...
0
votes
2
answers
227
views
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(...
1
vote
0
answers
49
views
Update google cloud composer withterragrunt
I am trying to update cloud composer from composer-1.17.3-airflow-1.10.14 to composer-1.17.10-airflow-1.10.15 using terragrunt.
After one hour it fails with the message:
Upgrade database failed.
...
0
votes
0
answers
93
views
Terragrunt assumed role can't access S3
I'm trying to run terragrunt->terraform with assumed roles cross account.
I'm running from a container (I validated the container uses the right role) I've set my aws/credentials profile to work ...
1
vote
1
answer
120
views
Running terragrunt run-all destroy in Jenkins needs user input
I am currently using terragrunt to manage my terraform code, and am running into an error when trying to destroy my infrastructure. I want to be able to spin up development environments (or parts of ...
0
votes
0
answers
44
views
How to upgrade the terraform version in remote state of a terragrunt project?
I used Terragrunt with a remote state in S3. The remote state file contains the terraform version, currently 0.14.8. I updated to 0.14.11 locally and ran a terragrunt apply but the version in the ...
1
vote
0
answers
80
views
IAM Role for Terragrunt
I am reviewing this website, https://terragrunt.gruntwork.io/docs/getting-started/quick-start/
where they discuss an IAM role for Terragrunt as in the following code
provider "aws" {
...
0
votes
1
answer
230
views
How do I refer to a specific branch of a private git repo in Terragrunt?
I want to refer to a feature/IaC (any specific branch other than the main) branch of a multibranch private git repo as a source parameter of Terragrunt's configuration file.
Here is a piece of code ...
0
votes
1
answer
353
views
Terragrunt provider.tf generation not generating files
The expectation is that when running a terragrunt run-all apply from the root directory, a provider.tf file will be created in the sub directories. I've verified my backend is able to talk to my azure ...
0
votes
1
answer
70
views
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 =...
0
votes
1
answer
156
views
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 ...
1
vote
1
answer
100
views
How to define "%{" as string in terraform
I'm trying to add SSM paramater value for aws via terrafom but terrafom consider %{ for defining condition and its giving below error.
Error:- Invalid template directive; A template directive keyword ...
1
vote
1
answer
107
views
How to enable basic authentication in Atlantis?
I'm trying to enable basic auth for atlantis I have followed the official docs here however it seems the below settings are not honored by atlantis
docker run runatlantis/atlantis:v0.18.1 server --...
0
votes
0
answers
53
views
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 ...
0
votes
0
answers
105
views
Error when running terragrunt run-all plan
I have multiple environment Testing and Production ,I want to verify terragrunt run-all plan(plan) with checkov when GitHubActions workflow is triggered.I want the plan saved in tfplan.binary then ...
0
votes
1
answer
1k
views
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 ...
0
votes
0
answers
87
views
Provision Multiple AWS Neptune Clusters from Terraform and Terragrunt
I have a working script/template for provisioning single AWS Neptune cluster using Terraform and Terragrunt but now I have to update it to provision multiple clusters in the same region.
This is how ...
0
votes
0
answers
24
views
Unable to save tfplan.binary converted json to modules directory
I want to verify checkov with terragrunt run-all plan when my workflow on GitHub Actions is triggered.I want to save the plan in tfplan.binary then convert that to JSON and have it put into plan.json ...
2
votes
1
answer
180
views
Jenkinsfile - Pipeline job stuck at input() step
I'm running terraform pipeline through Jenkinsfile, where I'm using a input(...) block for the user approval, before apply. This is the code snippet:
stage('tf_plan') {
agent {
label: 'Jenkins-...
0
votes
1
answer
158
views
How does your terraform pipeline look like with trunk based development?
I was brainstorming the other day with a colleague, on how you should deploy to multiple AWS accounts by making use of trunk based development (feature/ -> master).
The idea of deploying to ...
1
vote
0
answers
53
views
Suppress millions of "Refreshing state..." lines in terraform / terragrunt plan output
I am invoking terraform using terragrunt. I have a multitude of resources in my state file, so on each plan I see the extremely noisy output of millions of lines in the likes of
random_string....
1
vote
0
answers
105
views
Would it be possible to generate aws provider blocks via terragrunt, based on a data "aws_organizations_organization" "all" {} call?
I have no idea if this would work, but I would like to use terragrunt to generate my providers blocks dynamically. Dynamic providers are currently not allowed (https://github.com/hashicorp/terraform/...
1
vote
0
answers
308
views
Terragrunt error message when trying to impersonate account
I am setting up Terragrunt on our project to be able to plan and apply multiple modules at the same time. We are on GCP. Terraform uses a service account dedicated to our CI/CD (one per env) which ...
0
votes
0
answers
483
views
tgenv 0.18.7 - fatal error: runtime: bsdthread_register error
I'm trying to use tgenv version 0.18.7, but when I do error occurs :
Versions 0.19 and above seem to work fine, but under that I get this error.
Reading through https://github.com/golang/go/wiki/...
0
votes
1
answer
455
views
"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 ...
0
votes
1
answer
135
views
terraform loop with a conditional key inside an object
let's suppose we have this variable:
foobars = {
"first" : {
specialkeys: [
"a",
"b",
"c"
]
}
"second&...
0
votes
1
answer
62
views
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 ...
0
votes
1
answer
210
views
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 ...
0
votes
0
answers
102
views
need clarity on advantages of terragrunt instead of tfvars file
I'm new to terragrunt and terraform. Right now i'm little confused about why to use terragrunt instead of tfvars file.
My scenario is for one of the application we create multiple resources like ...
1
vote
1
answer
302
views
Create dynamic block in terraform
I wanted to create google_compute_health_check in terraform and I'm thinking about how to make them the most versatile. My code atm looks like that
application.hcl
inputs = {
health_checks = {
...
0
votes
1
answer
103
views
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 ...
1
vote
1
answer
2k
views
Google Cloud platform terraform/terragrunt googleapi: Error 409: Requested entity already exist
I am having a strange issue when trying to push code out to our gcp repo. It fails with the following error "googleapi: Error 409: Requested entity already exists, alreadyExists" and it is ...
1
vote
1
answer
218
views
Terraform How To Interpolate Name Of Data Resource In Module Call
My goal is to call a policy module using a for_each such that for each policy name input, the correct policy_document is selected. Is there a way to do this? Example where the input is a map with a ...
0
votes
1
answer
69
views
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 ...
0
votes
1
answer
391
views
Environment variables apparently not being passed to a systemd service invocation
Here is the case:
I am writing a go program.
At some point, the program calls terragrunt cli, via os.Exec().
The program is run on a machine having systemd version 232.
Up till know, I have been ...
0
votes
0
answers
64
views
How to create custome resources to be used in root module terragrunt
Hi I am trying to implement terragrunt on a new Terraform reop. I and referencing a module from the terraform registry and creating several different environments. Below is the directory structure I ...
0
votes
1
answer
324
views
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 ...
0
votes
2
answers
189
views
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 ...
0
votes
0
answers
189
views
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] ...