Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: Missing reference to Claranet Terraform modules #245

Open
mloskot opened this issue Oct 7, 2023 · 6 comments
Open

docs: Missing reference to Claranet Terraform modules #245

mloskot opened this issue Oct 7, 2023 · 6 comments

Comments

@mloskot
Copy link

mloskot commented Oct 7, 2023

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?
    ...
@pdecat
Copy link
Member

pdecat commented Oct 9, 2023

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.

@mloskot
Copy link
Author

mloskot commented Oct 9, 2023

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.

@pdecat
Copy link
Member

pdecat commented Oct 10, 2023

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

@BzSpi
Copy link
Contributor

BzSpi commented Oct 10, 2023

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.

@mloskot
Copy link
Author

mloskot commented Oct 10, 2023

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

@mloskot
Copy link
Author

mloskot commented Oct 28, 2023

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants