News for hackers. Stuff that matters.
Re:Terraform 1.0 by samsquire on Tuesday June 08, 2021 @09:24AM (#27434816)
There is a dupe Terraform post on Hacker news frontpage. I'll post my comment here too :-)

I recommend breaking out your terraform code into separate folders and calling them "components". Write a wrapper around the terraform script to pass in -var-file which uses an argument called ENVIRONMENT that you pass to the wrapper. I think the built in support for modules is less useful for what you actually want to do because you end up with variables spread between variables.tf, outputs.tf files. I use a tool I wrote to layer my infrastructure with layers called components and I configure it with a Graphviz file.

My tool, called mazzle (previously devops-pipeline) would run parts of the graph that can run in parallel in parallel. It can also run parts of the build on SSH workers. You bring up the workers at the beginning of the build.

Here's an example of a graph generated from graphviz file: https://github.com/samsquire/mazzle-starter/blob/master/arch...

This graph brings up a hashicorp vault server, Java application, bastion proxy, consul, kubernetes, prometheus

here's the graphviz file:

https://github.com/samsquire/mazzle/blob/master/docs/archite...

It describes the ordering of the infrastructure, the invocation of Ansible, packer, shell scripts to set up vault etc.

The idea is to be able to bring up a new environment by changing one parameter. There's a React GUI too.

https://devops-pipeline.com

Re:Terraform 1.0 by ciisforsuckas on Tuesday June 08, 2021 @11:48AM (#27436731)
I've been using Terragrunt to keep my Terraform DRYU in a similar manner. It's a bit of a rethink in how you structure things but I've been happy so far.

https://terragrunt.gruntwork.io/

Re:Terraform 1.0 by whoomp12342 on Tuesday June 08, 2021 @01:53PM (#27438542)
does terragrunt work with azure and GCP or just aws?
Re:Terraform 1.0 by leetrout on Tuesday June 08, 2021 @02:51PM (#27439281)
Terragrunt extends Terraform functionality so it works with all Terraform providers.