What's the best solution to replicate terraform repositories' structure?

260 views Asked by At

I'm looking for a solution to replicate my terraform repositories structure that is always identical

  • config (dev/stg/prod - backend.tf + input.tfvars)
  • tests/
  • main.tf / variables.tf / outputs.tf
  • Jenkinsfile / version / CHANGELOG / README / CONTRIBUTING

I'm looking for a solution to reproduce this structure over new repositories by running a command line such as cookiecutter for Python code, for example.

My goal is to avoid copy/paste from one repo to another, and reuse as much as I can a base already coded (having something good from a DevOps perspective) I dont think cookie cutter supports terraform scripts and I dont know any other potential solution to reproduce terraform repos.

1

There are 1 answers

3
tongueroo On

Check out Terraspace. It builds Terraform projects to achieve DRY.

Here's a also blog article on it: Introducing Terraspace: The Terraform Framework