Skip to content

googleNetworkConnectivitySpoke

The NetworkConnectivity Spoke resource

Example Usage - router_appliance

/*Provider bindings are generated by running cdktf get.
See https://cdk.tf/provider-generation for more details.*/
import * as google from "./.gen/providers/google";
/*The following providers are missing schema information and might need manual adjustments to synthesize correctly: google.
For a more precise conversion please use the --provider flag in convert.*/
const googleComputeNetworkNetwork = new google.computeNetwork.ComputeNetwork(
  this,
  "network",
  {
    auto_create_subnetworks: false,
    name: "network",
  }
);
const googleComputeSubnetworkSubnetwork =
  new google.computeSubnetwork.ComputeSubnetwork(this, "subnetwork", {
    ip_cidr_range: "10.0.0.0/28",
    name: "subnet",
    network: googleComputeNetworkNetwork.selfLink,
    region: "us-west1",
  });
const googleNetworkConnectivityHubBasicHub =
  new google.networkConnectivityHub.NetworkConnectivityHub(this, "basic_hub", {
    description: "A sample hub",
    labels: [
      {
        "label-two": "value-one",
      },
    ],
    name: "hub",
  });
const googleComputeInstanceInstance =
  new google.computeInstance.ComputeInstance(this, "instance", {
    boot_disk: [
      {
        initialize_params: [
          {
            image:
              "projects/debian-cloud/global/images/debian-10-buster-v20210817",
          },
        ],
      },
    ],
    can_ip_forward: true,
    machine_type: "e2-medium",
    name: "instance",
    network_interface: [
      {
        access_config: [
          {
            network_tier: "PREMIUM",
          },
        ],
        network_ip: "10.0.0.2",
        subnetwork: googleComputeSubnetworkSubnetwork.name,
      },
    ],
    zone: "us-west1-a",
  });
new google.networkConnectivitySpoke.NetworkConnectivitySpoke(this, "primary", {
  description: "A sample spoke with a linked routher appliance instance",
  hub: googleNetworkConnectivityHubBasicHub.id,
  labels: [
    {
      "label-one": "value-one",
    },
  ],
  linked_router_appliance_instances: [
    {
      instances: [
        {
          ip_address: "10.0.0.2",
          virtual_machine: googleComputeInstanceInstance.selfLink,
        },
      ],
      site_to_site_data_transfer: true,
    },
  ],
  location: "us-west1",
  name: "name",
});

Argument Reference

The following arguments are supported:

  • hub - (Required) Immutable. The URI of the hub that this spoke is attached to.

  • location - (Required) The location for the resource

  • name - (Required) Immutable. The name of the spoke. Spoke names must be unique.

The instances block supports:

  • ipAddress - (Optional) The IP address on the VM to use for peering.

  • virtualMachine - (Optional) The URI of the virtual machine resource


  • description - (Optional) An optional description of the spoke.

  • labels - (Optional) Optional labels in key:value format. For more information about labels, see Requirements for labels.

  • linkedInterconnectAttachments - (Optional) A collection of VLAN attachment resources. These resources should be redundant attachments that all advertise the same prefixes to Google Cloud. Alternatively, in active/passive configurations, all attachments should be capable of advertising the same prefixes.

  • linkedRouterApplianceInstances - (Optional) The URIs of linked Router appliance resources

  • linkedVpnTunnels - (Optional) The URIs of linked VPN tunnel resources

  • project - (Optional) The project for the resource

The linkedInterconnectAttachments block supports:

  • siteToSiteDataTransfer - (Required) A value that controls whether site-to-site data transfer is enabled for these resources. Note that data transfer is available only in supported locations.

  • uris - (Required) The URIs of linked interconnect attachment resources

The linkedRouterApplianceInstances block supports:

  • instances - (Required) The list of router appliance instances

  • siteToSiteDataTransfer - (Required) A value that controls whether site-to-site data transfer is enabled for these resources. Note that data transfer is available only in supported locations.

The linkedVpnTunnels block supports:

  • siteToSiteDataTransfer - (Required) A value that controls whether site-to-site data transfer is enabled for these resources. Note that data transfer is available only in supported locations.

  • uris - (Required) The URIs of linked VPN tunnel resources.

Attributes Reference

In addition to the arguments listed above, the following computed attributes are exported:

  • id - an identifier for the resource with format projects/{{project}}/locations/{{location}}/spokes/{{name}}

  • createTime - Output only. The time the spoke was created.

  • state - Output only. The current lifecycle state of this spoke. Possible values: STATE_UNSPECIFIED, CREATING, ACTIVE, DELETING

  • uniqueId - Output only. The Google-generated UUID for the spoke. This value is unique across all spoke resources. If a spoke is deleted and another with the same name is created, the new spoke is assigned a different unique_id.

  • updateTime - Output only. The time the spoke was last updated.

Timeouts

This resource provides the following Timeouts configuration options:

  • create - Default is 20 minutes.
  • update - Default is 20 minutes.
  • delete - Default is 20 minutes.

Import

Spoke can be imported using any of these accepted formats:

$ terraform import google_network_connectivity_spoke.default projects/{{project}}/locations/{{location}}/spokes/{{name}}
$ terraform import google_network_connectivity_spoke.default {{project}}/{{location}}/{{name}}
$ terraform import google_network_connectivity_spoke.default {{location}}/{{name}}