docs: Missing reference to Claranet Terraform modules
Since the tfwrapper is Claranet-oriented, then it is valid to expect it would support use of Claranet production-ready Terraform modules.
I think, the wrapper documentation, especially Stacks file structure, should touch on best practices on using the modules in a project:
- Does
tfwrapperoffer any features to refer/link/import the modules? - If not, where it is suggested to put them?
- Share between account/environment/stack or make as local as possible?
- Host them as a copy or via Git submodule? ...
All sorts of modules are supported, tfwrapper does not make any assumption about them.
You just use any module with the vanilla source argument of a terraform module block.
For modules that are not really reusable beyond a project, there's effectively a pattern of keeping them at the root of a project under a modules or common directory, and then referencing them locally across the stacks.
I have encountered convention to use Clara modules like
mkdir -p terraform/modules/terraform_azurerm_nsg
then export https://github.com/claranet/terraform-azurerm-nsg.git into terraform/modules/terraform_azurerm_nsg, or add as Git submodule.
I wondered how Claranet folks structure it in a project based on the tfwrapper that also uses Claranet modules.
Including such example in docs would be a nice touch to newbies, I think.
Hmm, I'm not aware of such usage internally. @Shr3ps @BzSpi does that speak to you?
Hi,
Never heard of that behavior. Since modules are public, they're mostly retrieved from registry or, for a very few customers, mirrored from Github and used through their git as source.
Good point on the preference of the registry as source of Claranet modules. Thanks @pdecat @BzSpi
I've been looking for a repo with a good example project that shows Claranet's own best practices of
- using the tfwrapper
- composition of templates for tfwrapper
- structure of environments and stacks
I think such repo would be a very useful complement to the whole collection here.