Loading...
Loading...
# Terraform Issue: Provider functions in child modules fail with "Unknown provider function" after upgrading to 1.15 ## Terraform Version ` Terraform v1.15.0 (latest stable as of 2026-04-29) ` Regression from: **Terraform 1.14.9** (works correctly) ## Terraform Configuration Files ### Root module (main.tf) ``` hcl terraform { required_version = "~> 1.0" required_providers { azurerm = { source = "hashicorp/azurerm" version = "4.69.0" } } } provider "azurerm" { features {} } module "child" { source = "github.com/myorg/my-child-module" } ``` ### Child module (provider.tf) ``` hcl terraform { required_version = ">= 1.12" required_providers { azurerm = { source = "hashicorp/azurerm" version = ">= 4.30.0" } } } ``` ### Child module (locals.tf) ``` hcl locals { resource_group_name = provider::azurerm::parse_resource_id(var.resource_group_id)["resource_group_name"] } ``` ## Expected Behavior `terraform init` should succeed as it did in Terraform 1.14.9. The `azurerm` provider is declared in the child module's `required_providers` block, and `parse_resource_id` is a valid provider function available in azurerm >= 4.14.0. ## Actual Behavior `terraform init` fails immediately after downloading modules, before reaching the "Initializing provider plugins" phase: ``` Initializing modules... Downloading git::https://github.com/myorg/my-child-module.git for child... - child in .terraform/modules/child ╷ │ Error: Unknown provider function │ │ on .terraform/modules/child/locals.tf line 2, in locals: │ 2: resource_group_name = provider::azurerm::parse_resource_id(var.resource_group_id)["resource_group_name"] │ │ There is no function named "provider::azurerm::parse_resource_id". Ensure │ that provider name "azurerm" is declared in this module's │ required_providers block, and that this provider offers a function named │ "parse_resource_id". ╵ ``` ## Steps to Reproduce 1. Create a root module that references a child module via a git source 2. The child module declares `azurerm` in its own `required_providers` and uses a provider function (e.g. `provider::azurerm::parse_resource_id`) 3. Run `terraform init` with Terraform 1.15.0 ## Additional Context - This worked correctly in **Terraform 1.14.9** and all prior versions supporting provider functions (1.8+). - The regression appears to be related to the module validation changes introduced in 1.15 (dynamic module sources feature). Provider function references in child modules are being validated before the child module's `required_providers` block is fully resolved during init. - The provider IS correctly declared in the child module's `required_providers` block. - The provider function (`parse_resource_id`) IS available in the specified azurerm provider version. - Downgrading to Terraform 1.14.9 immediately resolves the issue with no configuration changes. - This affects any child module (sourced via git, registry, or local path) that uses provider functions. ## Workaround Pin `terraform_version` to `1.14.9` when using `hashicorp/setup-terraform` in CI/CD workflows.
Click on a version to see all relevant bugs
Terraform Integration
Learn more about where this data comes from
Bug Scrub Advisor
Streamline upgrades with automated vendor bug scrubs
BugZero Enterprise
Wish you caught this bug sooner? Get proactive today.