Closed jedierik20 closed 4 years ago
Check out https://github.com/gruntwork-io/terragrunt. It does exactly what I describe in the book :)
So, did I understood correctly, example from the book not works without a terragrunt?
The book outlines the basic approach to using pipelines. That approach is not natively supported by Terraform itself yet, so you have to implement it yourself. There are many ways to do it. One way is to use Terragrunt. Another is to use S3 as described by Kief Morrison.
No - I don't believe there was specific code in the book to cover this - and honestly, I'm using all of the advanced topics covered - DRY, modular, remote state, sub-dirs, live layouts, larger teams, etc. For this issue - i think Yevgeniy is spot on, and the way that I'm doing pipelines is using Terragrunt - which is an excellent wrapper for doing these advanced functions, but is slightly outside the scope of the book. Besides, I am quite certain, if you run into issues in this area, and add to this thread, someone (maybe even the author himself) would jump in and help (he did several times for me!).
I believe the question here was answered. Closing this ~3 year old issue.
I'm sure I'm missing one singular piece of logic to connect these dots, but I'm trying to create the mechanism described in the section regardling "Larger Teams May Need to Use a Development Pipeline". Specifically I've got tfvars in my specific environment dirs (aka: Figure 6-4). I have my source defined in that tfvars, but init, or get, or plan for that matter, are not downloading anything. It's a constant "no configuration files present".
However, as I wrote this, I finally solved the problem. The key issue deals with moving to the terraform init method. In your book, although you stated that we would need to make a wrapper to perform terraform init, it was a small logic leap that I missed which is the terraform init /source-dir /target-dir mechanism.
I was assuming (incorrectly) that init should be fed the tfvars and realize/use the source. this is not the case, and init needs to be done "manually" (seperately from tfvars) using the "SAME SOURCE" and choosing our tfvars dir as the destination (or not, but that would make the plan and apply much more difficult command lines).