Comments (7)
Hi there!
You need to start debugging from an internal directory and try to get it to work first:
cd terragrunt/staging/eu-central-1/vpc
terragrunt init
terragrunt apply
Then you can go one level up and try to run terragrunt apply-all
.
I don't think I have simple+working Terragrunt code in the open-source where common.tfvars
is used but maybe you can see how I write it in other places, too:
https://github.com/antonbabenko/modules.tf-demo
https://github.com/terraform-aws-modules/meta
In general, the questions related to the terragrunt are better to ask on the official repository as there are more users who may help you.
from terragrunt-reference-architecture.
Good that it works!
Yes, yamldecode
is an option if you want to deal with YAML or have a lot of variables.
I usually prefer to deal with hcl files using read_terragrunt_config()
as I have here - https://github.com/terraform-aws-modules/meta/blob/master/github/repositories/terraform-aws-modules/terraform-aws-appsync/terragrunt.hcl#L10
from terragrunt-reference-architecture.
That worked great and was much more intuitive as well. Thanks again as that helped unblocked me!
from terragrunt-reference-architecture.
For future reference I realized I misread the commands.
I needed terragrunt run-all plan
for this to work correctly. Now my output is correct. I didn't realize I was nesting 2 layers of subcommands.
The other bit someone in sweetops slack community mentioned was deprecation of using tfvars.
Instead they said to use:
inputs = merge(
# Configure Terragrunt to use common vars encoded as yaml to help you keep often-repeated variables (e.g., account ID)
# DRY. We use yamldecode to merge the maps into the inputs, as opposed to using varfiles due to a restriction in
# Terraform >=0.12 that all vars must be defined as variable blocks in modules. Terragrunt inputs are not affected by
# this restriction.
yamldecode(
file("${find_in_parent_folders("region.yaml", "empty.yaml")}"),
),
yamldecode(
file("${find_in_parent_folders("env.yaml", "empty.yaml")}"),
),
due to the changes in the behavior that block the tfvars from being pulled in correctly, while yaml works fine in loading into TF
inputs.
I'm still having a problem with it loading a parent file from a child, but will work from your example and see if I can get this to work then.
from terragrunt-reference-architecture.
It worked this time from parent directory! Woot Woot. 🎉
Thanks again for the help.
from terragrunt-reference-architecture.
Much better. Prefer to keep it terraform focused and not yaml. Will give that a try
from terragrunt-reference-architecture.
You are welcome.
Maybe I should have one more episode about Terragrunt during Your Weekly Dose of Terraform. Who knows :)
from terragrunt-reference-architecture.
Related Issues (7)
- [question] Can you share some thoughts on Terragrunt in the context of upcoming 0.12 and Terraform SaaS? HOT 6
- Clarify the VPC portion in acme-prod HOT 1
- Does this actually work? HOT 3
- Strange output with the Terragrunt alias HOT 2
- Reference Workflow HOT 1
- The terragrunt function wrapper is not compatible with the later versions of Terragrunt HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from terragrunt-reference-architecture.