From 50a449965f32ae39cd8a72622fdd6bd89c103e5c Mon Sep 17 00:00:00 2001 From: Luca Prete Date: Wed, 23 Aug 2023 13:34:11 +0200 Subject: [PATCH] Fix: align stage-2-e-nva-bgp to the latest APIs --- fast/stages/2-networking-e-nva-bgp/README.md | 2 +- fast/stages/2-networking-e-nva-bgp/ncc.tf | 20 +++++++++++++++---- .../stages/s2_networking_e_nva_bgp/stage.yaml | 2 +- 3 files changed, 18 insertions(+), 6 deletions(-) diff --git a/fast/stages/2-networking-e-nva-bgp/README.md b/fast/stages/2-networking-e-nva-bgp/README.md index 405ac719..eabd74db 100644 --- a/fast/stages/2-networking-e-nva-bgp/README.md +++ b/fast/stages/2-networking-e-nva-bgp/README.md @@ -488,7 +488,7 @@ DNS configurations are centralised in the `dns-*.tf` files. Spokes delegate DNS | [main.tf](./main.tf) | Networking folder and hierarchical policy. | folder · net-firewall-policy | | | [monitoring-vpn-onprem.tf](./monitoring-vpn-onprem.tf) | VPN monitoring alerts. | | google_monitoring_alert_policy | | [monitoring.tf](./monitoring.tf) | Network monitoring dashboards. | | google_monitoring_dashboard | -| [ncc.tf](./ncc.tf) | None | ncc-spoke-ra | | +| [ncc.tf](./ncc.tf) | None | ncc-spoke-ra | google_network_connectivity_hub | | [nva.tf](./nva.tf) | None | compute-vm · simple-nva | google_compute_address | | [outputs.tf](./outputs.tf) | Module outputs. | | google_storage_bucket_object · local_file | | [regions.tf](./regions.tf) | Compute short names for regions. | | | diff --git a/fast/stages/2-networking-e-nva-bgp/ncc.tf b/fast/stages/2-networking-e-nva-bgp/ncc.tf index d0d8766a..97fb5f37 100644 --- a/fast/stages/2-networking-e-nva-bgp/ncc.tf +++ b/fast/stages/2-networking-e-nva-bgp/ncc.tf @@ -14,6 +14,18 @@ * limitations under the License. */ +resource "google_network_connectivity_hub" "hub_trusted" { + name = "prod-hub-trusted" + description = "Prod hub trusted" + project = module.landing-project.project_id +} + +resource "google_network_connectivity_hub" "hub_untrusted" { + name = "prod-hub-untrusted" + description = "Prod hub untrusted" + project = module.landing-project.project_id +} + module "spokes-trusted" { for_each = var.regions source = "../../../modules/ncc-spoke-ra" @@ -22,8 +34,8 @@ module "spokes-trusted" { region = each.value hub = { - create = true, - name = "prod-hub-trusted-${each.value}" + create = false, + id = google_network_connectivity_hub.hub_trusted.id } router_appliances = [ @@ -72,8 +84,8 @@ module "spokes-untrusted" { region = each.value hub = { - create = true, - name = "prod-hub-untrusted-${each.value}" + create = false, + id = google_network_connectivity_hub.hub_untrusted.id } router_appliances = [ diff --git a/tests/fast/stages/s2_networking_e_nva_bgp/stage.yaml b/tests/fast/stages/s2_networking_e_nva_bgp/stage.yaml index fa62dac0..960ac523 100644 --- a/tests/fast/stages/s2_networking_e_nva_bgp/stage.yaml +++ b/tests/fast/stages/s2_networking_e_nva_bgp/stage.yaml @@ -14,4 +14,4 @@ counts: modules: 36 - resources: 210 + resources: 208