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_network_gateway: bgp_settings #1993

Closed
peterb154 opened this issue Sep 28, 2018 · 9 comments · Fixed by #2304
Closed

azurerm_virtual_network_gateway: bgp_settings #1993

peterb154 opened this issue Sep 28, 2018 · 9 comments · Fixed by #2304

Comments

@peterb154
Copy link

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

$ terraform -v
Terraform v0.11.8

  • provider.azurerm v1.15.0

Affected Resource(s)

  • azurerm_virtual_network_gateway

Terraform Configuration Files

resource "azurerm_virtual_network_gateway" "rg-prod-ncus-network__vgw-prod-ncus-infrahub" {
   name = "vgw-prod-ncus-infrahub"
   resource_group_name = "rg-prod-ncus-network"
   location = "northcentralus"
   type = "ExpressRoute"
   vpn_type = "PolicyBased"
   sku = "Standard"
   active_active = "false"
   enable_bgp = "false"
  ip_configuration {
     name = "default"
     private_ip_address_allocation = "Dynamic"
     public_ip_address_id = "${azurerm_public_ip.rg-prod-ncus-network__pip-prod-ncus-vgw-infrahub.id}"
     subnet_id = "${azurerm_subnet.rg-prod-ncus-network__GatewaySubnet.id}"
  }
}

Debug Output

https://gist.github.com/6aa4cd02e3c93f92fe83354e96224081

Panic Output

N/A

Expected Behavior

With azurerm_virtual_network_gateway paramameter: enable_bgp = "false"
and no "bgp_settings" defined in .tf file, and bgp is not enabled in Azure, terraform plan should detect no changes required.

$ az network vnet-gateway list -g rg-prod-ncus-network | jq .[0].name
"vgw-prod-ncus-infrahub"

$ az network vnet-gateway list -g rg-prod-ncus-network | jq .[0].enableBgp
false

$ az network vnet-gateway list -g rg-prod-ncus-network | jq .[0].bgpSettings
null

Actual Behavior

------------------------------------------------------------------------

An execution plan has been generated and is shown below.
Resource actions are indicated with the following symbols:
  ~ update in-place

Terraform will perform the following actions:

  ~ azurerm_virtual_network_gateway.rg-prod-ncus-network__vgw-prod-ncus-infrahub
      bgp_settings.#: "" => <computed>


Plan: 0 to add, 1 to change, 0 to destroy.

------------------------------------------------------------------------

Note: You didn't specify an "-out" parameter to save this plan, so Terraform
can't guarantee that exactly these actions will be performed if
"terraform apply" is subsequently run.

Steps to Reproduce

  1. terraform plan

Important Factoids

References

There is a discussion about this issue on reddit

  • #0000
@cripth
Copy link

cripth commented Oct 2, 2018

encounter the same issue. It probably due to Azure SDK behaviour that expect bgp setting even though expressRoute does not support BGP setting.

@midacts
Copy link
Contributor

midacts commented Nov 6, 2018

I've ran into this as well.
With the PowerShell AzureRM module is shows BGPSettings: null.

I don't send any bgp_settings in tf and it should bgp_settings => computed

@midacts
Copy link
Contributor

midacts commented Nov 14, 2018

Thanks for getting this working.

@peterb154
Copy link
Author

Thank you so much for the fix.

@midacts
Copy link
Contributor

midacts commented Nov 14, 2018

I'm still seeing bgp_settings.$: "" => <compute>
(I thought i ran a terraform plan earlier to test but I must have been in the wrong directory).

Do I need to update the terraform azurerm provider for these changes to come into affect?
Or will this be available in a future release?
(I ran terraform init but nothing new was pulled in)

provider "azurerm" {
  version         = "~> 1.4"

@tombuildsstuff
Copy link
Contributor

@midacts this hasn't been released yet - it'll be part of 1.19 when that release ships.

@peterb154
Copy link
Author

@midacts , @katbyte merged the code into the master branch, but they have not yet released a new version of the provider. The last release was 1.18.0 released 12 days ago.
https://github.com/terraform-providers/terraform-provider-azurerm/releases Historically, they have been releasing every 2 weeks or so. When they release version 1.19 it should be available in TF.

In the mean time, if you want to test the latest code in master branch, you could install it as a third party plugin https://www.terraform.io/docs/configuration/providers.html#third-party-plugins

@midacts
Copy link
Contributor

midacts commented Nov 16, 2018

Good to know about the release cycle.
I just ran a terraform init and saw 1.19 was available.

After downloading it I can confirm this is fixed.
(I'm starting to get the hang of terraform a little bit).

Thanks guys.

@ghost
Copy link

ghost commented Mar 5, 2019

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 feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. If you feel I made an error 🤖 🙉 , please reach out to my human friends 👉 hashibot-feedback@hashicorp.com. Thanks!

@ghost ghost locked and limited conversation to collaborators Mar 5, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.