Skip to content

Example Resource "powerplatform_enterprise_policy" dosen't work #718

@eduardodfmex

Description

@eduardodfmex
Contributor

powerplatform_enterprise_policy resource example dosen't work it has provider errors and depends errors.

The example for the resource "powerplatform_enterprise_policy" dosen't work it has provider errors and depends errors.

│ Error: Failed to query available provider packages

│ Could not retrieve the list of available versions for provider hashicorp/powerplatform: provider registry registry.terraform.io does not have a provider named
│ registry.terraform.io/hashicorp/powerplatform

│ All modules should specify their required_providers so that external consumers will get the correct providers when using a module. To see which modules are currently depending
│ on hashicorp/powerplatform, run the following command:
│ terraform providers

Sample Terraform Code

Link to the resource example:

https://github.com/microsoft/terraform-provider-power-platform/blob/main/examples/resources/powerplatform_enterprise_policy/resource.tf

Expected behavior

Providing the correct credentials and values the resource example should complete the terraform plan and terraform apply.

System Information

  • Provider Version: 3.5.0
  • OS & Version: Windows

Additional context

Add any other context about the problem here.

Activity

self-assigned this
on Apr 23, 2025
eduardodfmex

eduardodfmex commented on Apr 24, 2025

@eduardodfmex
ContributorAuthor

These are the Depends_on errors:

terraform validate

│ Error: Reference to undeclared resource

│ on resource.tf line 97, in module "encryption":
│ 97: depends_on = [powerplatform_enterprise_policy.network_injection]

│ A managed resource "powerplatform_enterprise_policy" "network_injection" has not been declared in the
│ root module.


│ Error: Reference to undeclared resource

│ on network_injection\main.tf line 156, in resource "powerplatform_enterprise_policy" "network_injection":
│ 156: depends_on = [powerplatform_managed_environment.managed_development]

│ A managed resource "powerplatform_managed_environment" "managed_development" has not been declared in
│ module.network_injection.

added theissue type on Apr 26, 2025
mawasile

mawasile commented on Jul 24, 2025

@mawasile
Contributor

copilot please update the powerplatform modules name in this example https://github.com/microsoft/terraform-provider-power-platform/blob/main/examples/resources/powerplatform_enterprise_policy/resource.tf it should be written without "-" in the name at line 5

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Example Resource "powerplatform_enterprise_policy" dosen't work · Issue #718 · microsoft/terraform-provider-power-platform