Last thing to consider is how you will organize your resources and directory layout. Would you use one or several repos? etc..
There is no one answer to that, but one common set up is to have your modules handled separately and called from a single repository
. Let’s take an example: if you have a module that knows how to properly configure a vpc
from two variables
, then you have some proper Terraform code. This code can be stored in a distinct Terraform git repo, managed, versioned and released like any other project. But still, it cannot be used “as is”. You still need your infra repo to call this module, a bit like you would do with a standard library
in engineering.
For some people, the folder hierarchy matters too. It’s very common to see test folders for all the testing, separate folders for the modules, and other folders for the environments as well.
One last common pattern that I think of, is the use of variables files with all the different kind of values you can have, so that environments can be sent to the execution using those environment variables.