cloud-foundation-fabric/modules/ncc-spoke-ra
simonebruzzechesse dd37d07955
Update ncc-spoke-ra module to explicity request ncc hub id when referencing existing hubs (#1479)
* Updated ncc-spoke-ra module to explicity requesting ncc hub id when referencing existing hub

* fix documentation

* updated hub variable description

* more explicit validation condition on hub variable
2023-07-10 16:18:42 +02:00
..
README.md Update ncc-spoke-ra module to explicity request ncc hub id when referencing existing hubs (#1479) 2023-07-10 16:18:42 +02:00
main.tf Update ncc-spoke-ra module to explicity request ncc hub id when referencing existing hubs (#1479) 2023-07-10 16:18:42 +02:00
outputs.tf Ensure all modules have an `id` output (#1410) 2023-06-02 16:07:22 +02:00
variables.tf Update ncc-spoke-ra module to explicity request ncc hub id when referencing existing hubs (#1479) 2023-07-10 16:18:42 +02:00
versions.tf allow using a separate resource for boot disk (#1496) 2023-07-07 15:40:13 +00:00

README.md

NCC Spoke RA Module

This module allows management of NCC Spokes backed by Router Appliances. Network virtual appliances used as router appliances allow to connect an external network to Google Cloud by using a SD-WAN router or another appliance with BGP capabilities (site-to-cloud connectivity). It is also possible to enable site-to-site data transfer, although this feature is not available in all regions, particularly not in EMEA.

The module manages a hub (optionally), a spoke, and the corresponding Cloud Router and BGP sessions to the router appliance(s).

Examples

Simple hub & spoke

module "spoke-ra" {
  source     = "./fabric/modules/ncc-spoke-ra"
  hub        = { create = true, name = "ncc-hub" }
  name       = "spoke-ra"
  project_id = "my-project"
  region     = "europe-west1"
  router_appliances = [
    {
      internal_ip  = "10.0.0.3"
      vm_self_link = "projects/my-project/zones/europe-west1-b/instances/router-app"
    }
  ]
  router_config = {
    asn           = 65000
    ip_interface0 = "10.0.0.14"
    ip_interface1 = "10.0.0.15"
    peer_asn      = 65001
  }
  vpc_config = {
    network_name     = "my-vpc"
    subnet_self_link = var.subnet.self_link
  }
}
# tftest modules=1 resources=7

Two spokes

module "spoke-ra-a" {
  source     = "./fabric/modules/ncc-spoke-ra"
  hub        = { id = "projects/my-project/locations/global/hubs/ncc-hub" }
  name       = "spoke-ra-a"
  project_id = "my-project"
  region     = "europe-west1"
  router_appliances = [
    {
      internal_ip  = "10.0.0.3"
      vm_self_link = "projects/my-project/zones/europe-west1-b/instances/router-app-a"
    }
  ]
  router_config = {
    asn           = 65000
    ip_interface0 = "10.0.0.14"
    ip_interface1 = "10.0.0.15"
    peer_asn      = 65001
  }
  vpc_config = {
    network_name     = "my-vpc1"
    subnet_self_link = "projects/my-project/regions/europe-west1/subnetworks/subnet"
  }
}

module "spoke-ra-b" {
  source     = "./fabric/modules/ncc-spoke-ra"
  hub        = { id = "projects/my-project/locations/global/hubs/ncc-hub" }
  name       = "spoke-ra-b"
  project_id = "my-project"
  region     = "europe-west3"
  router_appliances = [
    {
      internal_ip  = "10.1.0.5"
      vm_self_link = "projects/my-project/zones/europe-west3-b/instances/router-app-b"
    }
  ]
  router_config = {
    asn           = 65000
    ip_interface0 = "10.0.0.14"
    ip_interface1 = "10.0.0.15"
    peer_asn      = 65002
  }
  vpc_config = {
    network_name     = "my-vpc2"
    subnet_self_link = "projects/my-project/regions/europe-west3/subnetworks/subnet"
  }
}
# tftest modules=2 resources=12

Spoke with load-balanced router appliances

module "spoke-ra" {
  source     = "./fabric/modules/ncc-spoke-ra"
  hub        = { id = "projects/my-project/locations/global/hubs/ncc-hub" }
  name       = "spoke-ra"
  project_id = "my-project"
  region     = "europe-west1"
  router_appliances = [
    {
      internal_ip  = "10.0.0.3"
      vm_self_link = "projects/my-project/zones/europe-west1-b/instances/router-app-a"
    },
    {
      internal_ip  = "10.0.0.4"
      vm_self_link = "projects/my-project/zones/europe-west1-c/instances/router-app-b"
    }
  ]
  router_config = {
    asn = 65000
    custom_advertise = {
      all_subnets = true
      ip_ranges = {
        "10.10.0.0/24" = "peered-vpc"
      }
    }
    ip_interface0 = "10.0.0.14"
    ip_interface1 = "10.0.0.15"
    peer_asn      = 65001
  }
  vpc_config = {
    network_name     = "my-vpc"
    subnet_self_link = var.subnet.self_link
  }
}
# tftest modules=1 resources=8

Variables

name description type required default
hub The NCC hub. You should either provide an existing hub id or a hub name if create is true. object({…})
name The name of the NCC spoke. string
project_id The ID of the project where the NCC hub & spokes will be created. string
region Region where the spoke is located. string
router_appliances List of router appliances this spoke is associated with. list(object({…}))
router_config Configuration of the Cloud Router. object({…})
vpc_config Network and subnetwork for the CR interfaces. object({…})
data_transfer Site-to-site data transfer feature, available only in some regions. bool false

Outputs

name description sensitive
hub NCC hub resource (only if auto-created).
id Fully qualified hub id.
router Cloud Router resource.
spoke-ra NCC spoke resource.