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.51k stars 4.6k forks source link

Support for azurerm_relay_namespace/azurerm_relay_hybrid_connection data sources #21144

Open jared-koiter opened 1 year ago

jared-koiter commented 1 year ago

Is there an existing issue for this?

Community Note

Description

When connecting an Azure web app to a hybrid connection (https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/web_app_hybrid_connection) we need to reference an azurerm_relay_hybrid_connection ID which itself is part of an azurerm_relay_namespace. Creating and managing these resources with Terraform is fine, but we would like to be able to reference an existing hybrid connection relay/namespace created outside of Terraform. Manually entering the full resource ID is an option, but it would be nice if there was a data source for both the azurerm_relay_namespace and azurerm_relay_hybrid_connection resource types that would allow us to reference information from existing resources.

New or Affected Resource(s)/Data Source(s)

azurerm_relay_namespace, azurerm_relay_hybrid_connection

Potential Terraform Configuration

data "azurerm_relay_namespace" "example" {
  name                = "example-relay-namespace"
  resource_group_name = "example-resource-group"
}

data "azurerm_relay_hybrid_connection" "example" {
  name                = "example-relay-hybrid-connection"
  resource_group_name = "example-resource-group"
}

References

No response

matty commented 1 year ago

I have the same issue requiring a data source for relay hybrid connections. @mybayern1974 Did you find any solution?