I'm trying following code!
resource "google_compute_router" "gcp_cloud_router" {
name = "router-1"
network = var.gcp_vpc_name
region = var.gcp_region
bgp {
asn = 16550 # The Cloud Router used by PARTNER type interconnect attachments must be assigned a local ASN of '16550'
advertise_mode = "CUSTOM"
}
}
# GCP Cloud Interconnect creation.
resource "google_compute_interconnect_attachment" "fcr-to-gcp" {
project = var.gcp_project_id
region = var.gcp_region
name = "dx-to-gcp"
edge_availability_domain = "AVAILABILITY_DOMAIN_1"
type = "PARTNER"
router = google_compute_router.gcp_cloud_router.id
mtu = 1500
}
This code is creating a default BGP session too, which is attached to above attachment. But this BGP is missing Peer ASN. Anyone have idea how to add this BGP peer ASN using terraform?
It is not possible to add it via "google_compute_router_peer", because it is adding completelly new peer, and not allowing to use same VLAN Attachment.
So my question is "How to configure BGP on GCP Partner interconnect with terraform?"