Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

azurerm_virtual_hub_bgp_connection fails and expects existing provisioned HubVirtualNetworkConnection #17872

Closed
1 task done
JeffGiroux opened this issue Aug 3, 2022 · 5 comments · Fixed by #18469
Closed
1 task done
Labels
Milestone

Comments

@JeffGiroux
Copy link

JeffGiroux commented Aug 3, 2022

Is there an existing issue for this?

  • I have searched the existing issues

Community Note

  • Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
  • Please do not leave "+1" or "me too" comments, they generate extra noise for issue followers and do not help prioritize the request
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment

Terraform Version

1.1.5

AzureRM Provider Version

3.16.0

Affected Resource(s)/Data Source(s)

azurerm_virtual_hub_bgp_connection

Terraform Configuration Files

I took examples straight from the terraform Azure provider docs and modified slightly.

https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/virtual_hub_bgp_connection

As a result, this is my bgp connection block...

resource "azurerm_virtual_hub_bgp_connection" "example" {
  name           = "example"
  virtual_hub_id = azurerm_virtual_hub.vHub.id
  peer_asn       = 65530
  peer_ip        = "10.1.1.250"
}

Debug Output/Panic Output

Error: creating/updating Bgp Connection: (Name "example / Virtual Hub Name "giroux123-vHub-dd6a" / Resource Group "giroux123-rg-nva-dd6a"): network.VirtualHubBgpConnectionClient#CreateOrUpdate: Failure sending request: StatusCode=400 -- Original Error: Code="HubBgpConnectionMustReferenceFullyProvisionedHubVirtualNetworkConnection" Message="HubBgpConnection /subscriptions/xxxx-xxxx-xxxx-xxxx-xxxx/resourceGroups/giroux123-rg-nva-dd6a/providers/Microsoft.Network/virtualHubs/giroux123-vHub-dd6a/bgpConnections/bigip-1 must reference existing provisioned HubVirtualNetworkConnection." Details=[]

│   with azurerm_virtual_hub_bgp_connection.example,
│   on main.tf line 272, in resource "azurerm_virtual_hub_bgp_connection" "example":
│  272: resource "azurerm_virtual_hub_bgp_connection" "example" {

Expected Behaviour

BGP connection should successfully create based on provided input parameters of code block.

Actual Behaviour

"must reference existing provisioned HubVirtualNetworkConnection"

It appears that the BGP connection is looking for an existing hub connection...to which I do indeed have an existing hub connection. I created it with the below command block...

resource "azurerm_virtual_hub_connection" "nva" {
  name                      = format("%s-nva-%s", var.prefix, random_id.buildSuffix.hex)
  virtual_hub_id            = azurerm_virtual_hub.vHub.id
  remote_virtual_network_id = module.network["nva"].vnet_id
}

However, terraform apply fails with the error provided about requiring an existing hub connection. From a quick glance, the resource azurerm_virtual_hub_connection seems to require the ID of an existing virtual network connection. But yet, there is not an option to provide such parameter value.

Note: workaround, I can easily go into the portal and create a BGP connection by clicking around the UI. One of the dropdowns is indeed the "Virtual Network Connection" parameter as shown in the Azure docs link here - https://docs.microsoft.com/en-us/azure/virtual-wan/create-bgp-peering-hub-portal.

Steps to Reproduce

Use example bgp connection resource from the Azure terraform examples.
https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/virtual_hub_bgp_connection

Important Factoids

No response

References

No response

@JeffGiroux
Copy link
Author

I opened an Azure support ticket too, send them the failed terraform error when trying to add a BGP peer. Then support came back and said it's a terraform problem.

Can you please tell me why the "virtual network connection" is missing from the terraform resource block? We need that added in order to get past the BGP peer adding error.

From support...
I have engaged further resources to check your issue as well, and we found that at this point, this is a Terraform script/code related problem ( you need to check why there’s no option to provide the Hub Virtual network connection details, hence the insights need to come from Github/Terraform team, as it's clearly not an issue in the vWAN service/product.

@sinbai
Copy link
Contributor

sinbai commented Sep 22, 2022

@JeffGiroux thanks for opening this issue here. PR for resource azurerm_virtual_hub_bgp_connection to support virtual_network_connection_id has been submitted. Could you track it for updates?

@JeffGiroux
Copy link
Author

I see it and will watch. Thx.

@github-actions github-actions bot added this to the v3.25.0 milestone Sep 27, 2022
@github-actions
Copy link

This functionality has been released in v3.25.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
Copy link

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.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Oct 30, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
3 participants