hashicorp / terraform-provider-azurerm

Terraform provider for Azure Resource Manager
https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs
Mozilla Public License 2.0
4.61k stars 4.65k forks source link

azurerm_policy_definition can't find certain policy #3597

Closed davidobrien1985 closed 3 years ago

davidobrien1985 commented 5 years ago

Community Note

Terraform (and AzureRM Provider) Version

Terraform v0.12.0
+ provider.azurerm v1.29.0

Affected Resource(s)

Terraform Configuration Files

data "azurerm_policy_definition" "iso27001" {
  display_name = "[Preview]: Audit ISO 27001:2013 controls and deploy specific VM Extensions to support audit requirements"
}

Expected Behavior

Resource gets the info about the policy. This works for all other policies and policy sets, preview or not. Just not this one.

Actual Behavior

Error: Error loading Policy Definition List: could not find policy '[Preview]: Audit ISO 27001:2013 controls and deploy specific VM Extensions to support audit requirements'

  on modules/governance/03-main.tf line 5, in data "azurerm_policy_definition" "iso27001":
   5: data "azurerm_policy_definition" "iso27001" {
davidobrien1985 commented 5 years ago

@tombuildsstuff or whoever watches this repo, can anybody at least repro this issue?

DevSecNinja commented 4 years ago

Hi @davidobrien1985 - thanks for raising this. I'm facing the exact same issue and error message with another policy that is named like: [Audit] ThePolicyName - ThePolicy SubName. Hope this gets resolved soon as it's blocking our policy deployments. The only workaround so far is to use the policy definition ID.

favoretti commented 3 years ago

Since this issue has been reported a long time ago and relates to the version of provider we no longer support - I'm going to close it. Please open a new updated bug report on current versions of terraform and provider if this is still relevant. Thank you.

github-actions[bot] commented 3 years ago

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.