microsoft / terraform-provider-power-platform

Power Platform Terraform Provider
https://registry.terraform.io/providers/microsoft/power-platform/latest/docs
MIT License
35 stars 14 forks source link

`powerplatform_rest` has unexpected state when it doesn't have a create block defined #476

Closed mattdot closed 1 month ago

mattdot commented 1 month ago

Describe the bug

powerplatform_rest has unexpected state when it doesn't have a create block defined

Sample Terraform Code

If applicable, add terraform code to help explain your problem.

REMINDER: REMOVE SENSITIVE DATA SUCH AS SECRETS, USER NAMES, EMAILS, TENANT INFORMATION, ETC.

resource "powerplatform_rest" "business_unit_disable_on_destroy" {
  destroy = {
    scope                = "${local.dataverse_url}.default"
    method               = "PATCH"
    url                  = "${local.dataverse_url}api/data/v9.2/businessunits(${powerplatform_data_record.business_unit.id})"
    expected_http_status = [200, 204]
    body = jsonencode({
      isdisabled    = true
    })
  }
  depends_on = [powerplatform_data_record.business_unit]
}

Expected behavior

A clear and concise description of what you expected to happen.

System Information

Additional context

Add any other context about the problem here.

Contribution

Do you plan to raise a PR to address this issue? YES / NO?