Skip to content

Using Terraform Modules with provider.tf #806

Answered by Conzar
Conzar asked this question in Help
Discussion options

You must be logged in to vote

I found a solution:

  • Add required_providers block into root.hcl
  • Add a stub block in root.hcl that dynamically applies stubs for all providers that require configuration.
    • Terragrunt folders that use Modules that configure the providers block will turn off the stubs.
  • Create a separate file for managing private registry module versions.

This way, all module versions & provider versions are in the same place.
It will be the responsiblity of the terraform_control repository for managing the versions of everything (which is similar to other orchestration tools like Puppetfile for Puppet).

stub block in root.hcl

This section shows an example of auto-generating the stub block from per folder …

Replies: 2 comments 3 replies

Comment options

You must be logged in to vote
2 replies
@josh-padnick
Comment options

@justin-octo
Comment options

Answer selected by josh-padnick
Comment options

You must be logged in to vote
1 reply
@justin-octo
Comment options

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