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.59k stars 4.63k forks source link

Parse for hybridConnections is case sensitive, does not match reply from Az #20756

Closed andyyeh-maersk closed 1 year ago

andyyeh-maersk commented 1 year ago

Is there an existing issue for this?

Community Note

Terraform Version

1.2.6

AzureRM Provider Version

3.45.0

Affected Resource(s)/Data Source(s)

azurerm_web_app_hybrid_connection

Terraform Configuration Files

resource "azurerm_web_app_hybrid_connection" "web_app_hybrid_connection" {
  for_each = var.HYBRID_CONNECTION_TARGET.hybridconnections
  web_app_id = azurerm_windows_web_app.app_service.id
  relay_id   = azurerm_relay_hybrid_connection.shipmanager-api-proxy-hybrid-connection[each.key].id
  hostname   = each.value.hybrid_connection_target_server
  port       = each.value.hybrid_connection_target_server_port
  send_key_name = "defaultSender"
}

Debug Output/Panic Output

Error: parsing "/subscriptions/****/resourceGroups/shipmanager-prod/providers/Microsoft.Relay/namespaces/xxxx-api-proxy-relay-prod/hybridconnections/xxxx-dev": parsing segment "staticHybridConnections": expected the segment "hybridconnections" to be "hybridConnections"
│
│   with module.app-service-with-hybrid-connection.azurerm_web_app_hybrid_connection.web_app_hybrid_connection["xxxx-dev"],
│   on ..\..\stacks\app-service-with-hybrid-connection\hybrid-connection.tf line 53, in resource "azurerm_web_app_hybrid_connection" "web_app_hybrid_connection":
│   53: resource "azurerm_web_app_hybrid_connection" "web_app_hybrid_connection" {
│
│ parsing "/subscriptions/****/resourceGroups/shipmanager-prod/providers/Microsoft.Relay/namespaces/xxxx-api--proxy-relay-prod/hybridconnections/xxxx-dev": parsing
│ segment "staticHybridConnections": expected the segment "hybridconnections" to be "hybridConnections"

Expected Behaviour

The terraform plan execution executes successfully and azurerm_web_app_hybrid_connection is able to validate the current config against latest state.

Actual Behaviour

The parsing error occurs as it seems the provider is expecting hybridConnections in the resource string return by azure but instead azure is returning hybridconnections with lowercase c

Steps to Reproduce

No pre-existing resource -terraform apply

Important Factoids

No response

References

No response

andyyeh-maersk commented 1 year ago

az webapp hybrid-connection list --resource-group xxx-rg --name xxxx-dev

returns

{ "id": "/subscriptions/*/resourceGroups/shipmanager-prod/providers/Microsoft.Web/sites/xxxxx-dev/hybridConnectionNamespaces/xxxxx-/relays/xxxxxx", "location": "West Europe", "name": "xxxxxx", "properties": { "hostname": "somehostname", "port": YY, "relayArmUri": "/subscriptions/*****/resourceGroups/xxxx-dev/providers/Microsoft.Relay/namespaces/xxxxxx/hybridconnections/xxxxxxxxxx", "relayName": "xxxxxxxxxxxx", "serviceBusNamespace": "xxxxxxxxxxx-relay", "serviceBusSuffix": ".servicebus.windows.net" }, "resourceGroup": "xxxxx-dev", "type": "Microsoft.Web/sites/hybridConnectionNamespaces/relays" }

Seems to mismatch with the definition here: https://github.com/hashicorp/terraform-provider-azurerm/blob/a3b0749dd19719b6d83f381b8832fb1548d4f6d3/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/relay/2017-04-01/hybridconnections/id_hybridconnection.go#L126

andyyeh-maersk commented 1 year ago

Any indication on when this fix will be merged and put into a new release?

github-actions[bot] commented 1 year ago

This functionality has been released in v3.51.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 5 months 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.