How do I manage my Azure virtual WAN peering with Terraform?
Because configuring virtual hub peering requires approving the Konnect app in Microsoft Entra (a step that generates a link only available in the Konnect UI), you must complete the initial setup using the UI before managing the resource in Terraform.
After the peering is Ready, you can manage it with Terraform by importing the existing konnect_cloud_gateway_transit_gateway into your Terraform state. For a complete example, see cloud-gateways.tf. The following example shows what the resource block looks like:
resource "konnect_cloud_gateway_transit_gateway" "my_vhub_peering" {
network_id = var.network_id
azure_vhub_peering_gateway = {
name = "azure virtual hub peering"
transit_gateway_attachment_config = {
kind = "azure-vhub-peering-attachment"
tenant_id = var.tenant_id
subscription_id = var.subscription_id
resource_group_name = var.resource_group_name
vhub_name = var.vhub_name
}
}
}