tfwrapper icon indicating copy to clipboard operation
tfwrapper copied to clipboard

docs: Missing reference to Claranet Terraform modules

Open mloskot opened this issue 2 years ago • 6 comments

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 tfwrapper offer 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? ...

mloskot avatar Oct 07 '23 17:10 mloskot

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.

pdecat avatar Oct 09 '23 10:10 pdecat

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.

mloskot avatar Oct 09 '23 17:10 mloskot

Hmm, I'm not aware of such usage internally. @Shr3ps @BzSpi does that speak to you?

pdecat avatar Oct 10 '23 05:10 pdecat

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.

BzSpi avatar Oct 10 '23 06:10 BzSpi

Good point on the preference of the registry as source of Claranet modules. Thanks @pdecat @BzSpi

mloskot avatar Oct 10 '23 14:10 mloskot

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.

mloskot avatar Oct 28 '23 10:10 mloskot