-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
Expose bgpPeers from google_compute_router #11458
Comments
I'm not sure I understand here- |
GCP provision some bgpPeers automatically, there is no Terraform way to retrieve those peers, and so no way to change settings for them. The other alternative would be to have a google_compute_router_peers data source which we could use to retrieve all the peers on a given router. |
Is |
Not in any sort of automated way, consistent across environments no, as the bpgPeers have auto-generated names and interfaceNames. We'd end up with a situation where for every environment we'd have to deploy most of the infrastructure, but not the google_compute_router_peers, then manually discover the name and interfaceName of those peers, set them in variables, import them and then run the deploy again. That approach seems against the normal Terraform way of working. |
The google_compute_interconnect_attachment attribute cloud_router_ip_address maps directly to that generated interface. So can there be a reference to local_interface_ip(cloud_router_ip_address), that allows for appropriate reference without having to understand the order of the peers/interfaces? |
Here is another use case: automate the BGP creation with a partner (e.g. PacketFabric). I see 2 ways to approach this: (which could be both implemented actually!)
API reference: https://cloud.google.com/compute/docs/reference/rest/v1/routers/list
API reference: https://cloud.google.com/compute/docs/reference/rest/v1/interconnectAttachments/list |
I found a workaround by using the terraform-google-modules. Not the best but it works. |
i think it would be best if we can expose the bgpPeers automatically using the google_compute_router_peers data source |
I was hoping to use the import block introduced in TF 1.5.0 to import the BGP peer created by the interconnect attachment into a google_compute_router_peer resource and then update the ASN. However given the auto generated ID and lack of a data lookup for peers I couldn't figure out how to do that. Terraform Enterprise and Terraform Cloud have also stopped supporting the gcloud module so our previous way of handing this situation is now broken. |
What made TFE/TFC stop supporting the gcloud module? |
Hi Riley, there's an issue in that module repo: The TFE/TFC runners are ephemeral and we've heard from Hashi that their new custom agent images will not support installing the gcloud binary. We've tried it and it did not work. https://developer.hashicorp.com/terraform/enterprise/admin/infrastructure/worker-to-agent-migration |
Thanks! I'll flag w/ HashiCorp |
Community Note
Description
The gcloud command for describing a compute router includes the "bgpPeers" block, however the equivalent resource in Terraform, google_compute_router, does not expose this information via attributes. There appears to be no other resource or datasource which will expose this. When trying to apply settings to bgpPeers via the google_compute_router_peer resource, we need to feed in several pieces of information from this bgpPeers block, namely name, interface, peer_ip_address and peer_asn, all of which would come from the bpgPeers block, if it was exposed. Without this it appears impossible (without resorting to a local-exec method) to apply settings using google_compute_router_peer to an existing bpgPeer, such as those automatically created by GCP.
New or Affected Resource(s)
Potential Terraform Configuration
References
The text was updated successfully, but these errors were encountered: