A Provider Major Version Is a Breaking Change for Every Module Consumer

Every consumer of a shared module inherits a provider's breaking changes, whether or not the module changes.

  • Terraform
  • AzureRM
  • Module versioning

When AzureRM 4.0 arrived, a published private-endpoint module stopped working for consumers who had moved to the new provider. Nothing in the module had changed. The provider underneath had.

That's the trap with shared modules. A provider major version changes arguments and behaviour, and every consumer of your module inherits that change whether or not you release anything.

Three habits prevent it:

  1. Pin the provider range in the module, so consumers get a clear error instead of a confusing failure:

hcl terraform { required_providers { azurerm = { source = "hashicorp/azurerm" version = ">= 3.0, < 4.0" } } }

  1. Test the module against the new major before consumers upgrade, ideally with terraform test in the module's own pipeline.
  2. Release support for the new provider as a new module major, with upgrade notes, and keep the old major available until consumers move.

The rule of thumb: if the provider's major version changes, so does yours.

Get in touch