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

Updating azurerm_iothub_dps fails #20587

Closed lukipro closed 1 year ago

lukipro commented 1 year ago

Is there an existing issue for this?

Community Note

Terraform Version

1.3.6

AzureRM Provider Version

3.44.1

Affected Resource(s)/Data Source(s)

azurerm_iothub_dps

Terraform Configuration Files

resource "azurerm_iothub_dps" "dps" {
  name                = "provs-${module.common.resource_suffix}"
  resource_group_name = module.common.resource_group_name
  location            = var.azure_region
  linked_hub {
    location                = azurerm_iothub.iothub.location
    connection_string       = data.azurerm_iothub_shared_access_policy.iothubowner.primary_connection_string
    apply_allocation_policy = true
  }

  sku {
    name     = var.dps_sku
    capacity = var.dps_capacity
  }

  tags = module.common.tags
}

Debug Output/Panic Output

╷
│ Error: creating/updating IoT Device Provisioning Service Provisioning Service (Subscription: "xxxxxxxxxxxxxxxxx"
│ Resource Group Name: "rg-platform-prd-westeurope"
│ Provisioning Service Name: "provs-platform-prd-westeurope"): performing CreateOrUpdate: iotdpsresource.IotDpsResourceClient#CreateOrUpdate: Failure sending request: StatusCode=0 -- Original Error: Code="Failed" Message="The async operation failed." InnerError={"unmarshalError":"json: cannot unmarshal number into Go struct field serviceErrorInternal.code of type string"} AdditionalInfo=[{"code":400303,"httpStatusCode":"BadRequest","message":"The EnableDataResidency property may not be updated after initial IotDps creation. If you contact a support representative please include this correlation identifier: 48380527-ece0-4efd-a7ff-6a91929543f7, timestamp: 2023-02-20 13:21:15Z, errorcode: IH400303."}]
│ 
│   with azurerm_iothub_dps.dps,
│   on iothub.tf line 113, in resource "azurerm_iothub_dps" "dps":
│  113: resource "azurerm_iothub_dps" "dps" {
│ 
╵

Expected Behaviour

DPS gets updated.

Actual Behaviour

Error is thrown.

Steps to Reproduce

  1. Create a DPS resource with Terraform.
  2. Change a tag.
  3. Try to run terraform apply.

Important Factoids

No response

References

No response

myc2h6o commented 1 year ago

Hi @lukipro thanks for reporting this! It looks like a bug when adding the support for data_residency_enabled #18151, I'll add a fix soon.

github-actions[bot] commented 1 year ago

This functionality has been released in v3.45.0 of the Terraform Provider. Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading.

For further feature requests or bug reports with this functionality, please create a new GitHub issue following the template. Thank you!

github-actions[bot] commented 1 year 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.