How do I set up a centralized Tofu module repository for Terraform?

0
8
Asked By CloudyNinja93 On

I'm trying to set up a Tofu module repository for Terraform, but it seems like every example shows that each module needs its own Git path to load. Is there a way to pull in an entire repository of modules at once? Or would I need to create a custom provider to achieve that? I'd like to implement essential features such as tag requirements and sensible defaults. I've got the backend configuration sorted out, but I'm finding it challenging to integrate it into the pipeline templates for proper initialization. Any advice on how to centralize the modules effectively would be appreciated. Just to note, we are using Tofu in our setup.

2 Answers

Answered By TerraformGuru10 On

To add tag requirements, you can just use the `default_tags` block in your provider. That way, you can propagate tags to all your resources easily. For sane defaults, you can define variables with default values. It keeps things neat and avoids redundancy!

Answered By ModularHiker82 On

It's a bit unclear why you’d need just one repository for multiple modules—maybe there’s a specific scenario I’m missing. However, have you thought about setting up a private module registry? That could help keep everything organized without needing to load everything from a single repo.

Related Questions

LEAVE A REPLY

Please enter your comment!
Please enter your name here

This site uses Akismet to reduce spam. Learn how your comment data is processed.