gcp.networkconnectivity.Spoke
Explore with Pulumi AI
The NetworkConnectivity Spoke resource
To get more information about Spoke, see:
- API documentation
- How-to Guides
Example Usage
Network Connectivity Spoke Linked Vpc Network Basic
import * as pulumi from "@pulumi/pulumi";
import * as gcp from "@pulumi/gcp";
const network = new gcp.compute.Network("network", {
name: "net",
autoCreateSubnetworks: false,
});
const basicHub = new gcp.networkconnectivity.Hub("basic_hub", {
name: "hub1",
description: "A sample hub",
labels: {
"label-two": "value-one",
},
});
const primary = new gcp.networkconnectivity.Spoke("primary", {
name: "spoke1",
location: "global",
description: "A sample spoke with a linked router appliance instance",
labels: {
"label-one": "value-one",
},
hub: basicHub.id,
linkedVpcNetwork: {
excludeExportRanges: [
"198.51.100.0/24",
"10.10.0.0/16",
],
includeExportRanges: [
"198.51.100.0/23",
"10.0.0.0/8",
],
uri: network.selfLink,
},
});
import pulumi
import pulumi_gcp as gcp
network = gcp.compute.Network("network",
name="net",
auto_create_subnetworks=False)
basic_hub = gcp.networkconnectivity.Hub("basic_hub",
name="hub1",
description="A sample hub",
labels={
"label-two": "value-one",
})
primary = gcp.networkconnectivity.Spoke("primary",
name="spoke1",
location="global",
description="A sample spoke with a linked router appliance instance",
labels={
"label-one": "value-one",
},
hub=basic_hub.id,
linked_vpc_network={
"exclude_export_ranges": [
"198.51.100.0/24",
"10.10.0.0/16",
],
"include_export_ranges": [
"198.51.100.0/23",
"10.0.0.0/8",
],
"uri": network.self_link,
})
package main
import (
"github.com/pulumi/pulumi-gcp/sdk/v8/go/gcp/compute"
"github.com/pulumi/pulumi-gcp/sdk/v8/go/gcp/networkconnectivity"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
network, err := compute.NewNetwork(ctx, "network", &compute.NetworkArgs{
Name: pulumi.String("net"),
AutoCreateSubnetworks: pulumi.Bool(false),
})
if err != nil {
return err
}
basicHub, err := networkconnectivity.NewHub(ctx, "basic_hub", &networkconnectivity.HubArgs{
Name: pulumi.String("hub1"),
Description: pulumi.String("A sample hub"),
Labels: pulumi.StringMap{
"label-two": pulumi.String("value-one"),
},
})
if err != nil {
return err
}
_, err = networkconnectivity.NewSpoke(ctx, "primary", &networkconnectivity.SpokeArgs{
Name: pulumi.String("spoke1"),
Location: pulumi.String("global"),
Description: pulumi.String("A sample spoke with a linked router appliance instance"),
Labels: pulumi.StringMap{
"label-one": pulumi.String("value-one"),
},
Hub: basicHub.ID(),
LinkedVpcNetwork: &networkconnectivity.SpokeLinkedVpcNetworkArgs{
ExcludeExportRanges: pulumi.StringArray{
pulumi.String("198.51.100.0/24"),
pulumi.String("10.10.0.0/16"),
},
IncludeExportRanges: pulumi.StringArray{
pulumi.String("198.51.100.0/23"),
pulumi.String("10.0.0.0/8"),
},
Uri: network.SelfLink,
},
})
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Gcp = Pulumi.Gcp;
return await Deployment.RunAsync(() =>
{
var network = new Gcp.Compute.Network("network", new()
{
Name = "net",
AutoCreateSubnetworks = false,
});
var basicHub = new Gcp.NetworkConnectivity.Hub("basic_hub", new()
{
Name = "hub1",
Description = "A sample hub",
Labels =
{
{ "label-two", "value-one" },
},
});
var primary = new Gcp.NetworkConnectivity.Spoke("primary", new()
{
Name = "spoke1",
Location = "global",
Description = "A sample spoke with a linked router appliance instance",
Labels =
{
{ "label-one", "value-one" },
},
Hub = basicHub.Id,
LinkedVpcNetwork = new Gcp.NetworkConnectivity.Inputs.SpokeLinkedVpcNetworkArgs
{
ExcludeExportRanges = new[]
{
"198.51.100.0/24",
"10.10.0.0/16",
},
IncludeExportRanges = new[]
{
"198.51.100.0/23",
"10.0.0.0/8",
},
Uri = network.SelfLink,
},
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.gcp.compute.Network;
import com.pulumi.gcp.compute.NetworkArgs;
import com.pulumi.gcp.networkconnectivity.Hub;
import com.pulumi.gcp.networkconnectivity.HubArgs;
import com.pulumi.gcp.networkconnectivity.Spoke;
import com.pulumi.gcp.networkconnectivity.SpokeArgs;
import com.pulumi.gcp.networkconnectivity.inputs.SpokeLinkedVpcNetworkArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;
public class App {
public static void main(String[] args) {
Pulumi.run(App::stack);
}
public static void stack(Context ctx) {
var network = new Network("network", NetworkArgs.builder()
.name("net")
.autoCreateSubnetworks(false)
.build());
var basicHub = new Hub("basicHub", HubArgs.builder()
.name("hub1")
.description("A sample hub")
.labels(Map.of("label-two", "value-one"))
.build());
var primary = new Spoke("primary", SpokeArgs.builder()
.name("spoke1")
.location("global")
.description("A sample spoke with a linked router appliance instance")
.labels(Map.of("label-one", "value-one"))
.hub(basicHub.id())
.linkedVpcNetwork(SpokeLinkedVpcNetworkArgs.builder()
.excludeExportRanges(
"198.51.100.0/24",
"10.10.0.0/16")
.includeExportRanges(
"198.51.100.0/23",
"10.0.0.0/8")
.uri(network.selfLink())
.build())
.build());
}
}
resources:
network:
type: gcp:compute:Network
properties:
name: net
autoCreateSubnetworks: false
basicHub:
type: gcp:networkconnectivity:Hub
name: basic_hub
properties:
name: hub1
description: A sample hub
labels:
label-two: value-one
primary:
type: gcp:networkconnectivity:Spoke
properties:
name: spoke1
location: global
description: A sample spoke with a linked router appliance instance
labels:
label-one: value-one
hub: ${basicHub.id}
linkedVpcNetwork:
excludeExportRanges:
- 198.51.100.0/24
- 10.10.0.0/16
includeExportRanges:
- 198.51.100.0/23
- 10.0.0.0/8
uri: ${network.selfLink}
Network Connectivity Spoke Router Appliance Basic
import * as pulumi from "@pulumi/pulumi";
import * as gcp from "@pulumi/gcp";
const network = new gcp.compute.Network("network", {
name: "tf-test-network_75413",
autoCreateSubnetworks: false,
});
const subnetwork = new gcp.compute.Subnetwork("subnetwork", {
name: "tf-test-subnet_55138",
ipCidrRange: "10.0.0.0/28",
region: "us-central1",
network: network.selfLink,
});
const instance = new gcp.compute.Instance("instance", {
name: "tf-test-instance_37559",
machineType: "e2-medium",
canIpForward: true,
zone: "us-central1-a",
bootDisk: {
initializeParams: {
image: "projects/debian-cloud/global/images/debian-10-buster-v20210817",
},
},
networkInterfaces: [{
subnetwork: subnetwork.name,
networkIp: "10.0.0.2",
accessConfigs: [{
networkTier: "PREMIUM",
}],
}],
});
const basicHub = new gcp.networkconnectivity.Hub("basic_hub", {
name: "tf-test-hub_91980",
description: "A sample hub",
labels: {
"label-two": "value-one",
},
});
const primary = new gcp.networkconnectivity.Spoke("primary", {
name: "tf-test-name_37118",
location: "us-central1",
description: "A sample spoke with a linked routher appliance instance",
labels: {
"label-one": "value-one",
},
hub: basicHub.id,
linkedRouterApplianceInstances: {
instances: [{
virtualMachine: instance.selfLink,
ipAddress: "10.0.0.2",
}],
siteToSiteDataTransfer: true,
includeImportRanges: ["ALL_IPV4_RANGES"],
},
});
import pulumi
import pulumi_gcp as gcp
network = gcp.compute.Network("network",
name="tf-test-network_75413",
auto_create_subnetworks=False)
subnetwork = gcp.compute.Subnetwork("subnetwork",
name="tf-test-subnet_55138",
ip_cidr_range="10.0.0.0/28",
region="us-central1",
network=network.self_link)
instance = gcp.compute.Instance("instance",
name="tf-test-instance_37559",
machine_type="e2-medium",
can_ip_forward=True,
zone="us-central1-a",
boot_disk={
"initialize_params": {
"image": "projects/debian-cloud/global/images/debian-10-buster-v20210817",
},
},
network_interfaces=[{
"subnetwork": subnetwork.name,
"network_ip": "10.0.0.2",
"access_configs": [{
"network_tier": "PREMIUM",
}],
}])
basic_hub = gcp.networkconnectivity.Hub("basic_hub",
name="tf-test-hub_91980",
description="A sample hub",
labels={
"label-two": "value-one",
})
primary = gcp.networkconnectivity.Spoke("primary",
name="tf-test-name_37118",
location="us-central1",
description="A sample spoke with a linked routher appliance instance",
labels={
"label-one": "value-one",
},
hub=basic_hub.id,
linked_router_appliance_instances={
"instances": [{
"virtual_machine": instance.self_link,
"ip_address": "10.0.0.2",
}],
"site_to_site_data_transfer": True,
"include_import_ranges": ["ALL_IPV4_RANGES"],
})
package main
import (
"github.com/pulumi/pulumi-gcp/sdk/v8/go/gcp/compute"
"github.com/pulumi/pulumi-gcp/sdk/v8/go/gcp/networkconnectivity"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
network, err := compute.NewNetwork(ctx, "network", &compute.NetworkArgs{
Name: pulumi.String("tf-test-network_75413"),
AutoCreateSubnetworks: pulumi.Bool(false),
})
if err != nil {
return err
}
subnetwork, err := compute.NewSubnetwork(ctx, "subnetwork", &compute.SubnetworkArgs{
Name: pulumi.String("tf-test-subnet_55138"),
IpCidrRange: pulumi.String("10.0.0.0/28"),
Region: pulumi.String("us-central1"),
Network: network.SelfLink,
})
if err != nil {
return err
}
instance, err := compute.NewInstance(ctx, "instance", &compute.InstanceArgs{
Name: pulumi.String("tf-test-instance_37559"),
MachineType: pulumi.String("e2-medium"),
CanIpForward: pulumi.Bool(true),
Zone: pulumi.String("us-central1-a"),
BootDisk: &compute.InstanceBootDiskArgs{
InitializeParams: &compute.InstanceBootDiskInitializeParamsArgs{
Image: pulumi.String("projects/debian-cloud/global/images/debian-10-buster-v20210817"),
},
},
NetworkInterfaces: compute.InstanceNetworkInterfaceArray{
&compute.InstanceNetworkInterfaceArgs{
Subnetwork: subnetwork.Name,
NetworkIp: pulumi.String("10.0.0.2"),
AccessConfigs: compute.InstanceNetworkInterfaceAccessConfigArray{
&compute.InstanceNetworkInterfaceAccessConfigArgs{
NetworkTier: pulumi.String("PREMIUM"),
},
},
},
},
})
if err != nil {
return err
}
basicHub, err := networkconnectivity.NewHub(ctx, "basic_hub", &networkconnectivity.HubArgs{
Name: pulumi.String("tf-test-hub_91980"),
Description: pulumi.String("A sample hub"),
Labels: pulumi.StringMap{
"label-two": pulumi.String("value-one"),
},
})
if err != nil {
return err
}
_, err = networkconnectivity.NewSpoke(ctx, "primary", &networkconnectivity.SpokeArgs{
Name: pulumi.String("tf-test-name_37118"),
Location: pulumi.String("us-central1"),
Description: pulumi.String("A sample spoke with a linked routher appliance instance"),
Labels: pulumi.StringMap{
"label-one": pulumi.String("value-one"),
},
Hub: basicHub.ID(),
LinkedRouterApplianceInstances: &networkconnectivity.SpokeLinkedRouterApplianceInstancesArgs{
Instances: networkconnectivity.SpokeLinkedRouterApplianceInstancesInstanceArray{
&networkconnectivity.SpokeLinkedRouterApplianceInstancesInstanceArgs{
VirtualMachine: instance.SelfLink,
IpAddress: pulumi.String("10.0.0.2"),
},
},
SiteToSiteDataTransfer: pulumi.Bool(true),
IncludeImportRanges: pulumi.StringArray{
pulumi.String("ALL_IPV4_RANGES"),
},
},
})
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Gcp = Pulumi.Gcp;
return await Deployment.RunAsync(() =>
{
var network = new Gcp.Compute.Network("network", new()
{
Name = "tf-test-network_75413",
AutoCreateSubnetworks = false,
});
var subnetwork = new Gcp.Compute.Subnetwork("subnetwork", new()
{
Name = "tf-test-subnet_55138",
IpCidrRange = "10.0.0.0/28",
Region = "us-central1",
Network = network.SelfLink,
});
var instance = new Gcp.Compute.Instance("instance", new()
{
Name = "tf-test-instance_37559",
MachineType = "e2-medium",
CanIpForward = true,
Zone = "us-central1-a",
BootDisk = new Gcp.Compute.Inputs.InstanceBootDiskArgs
{
InitializeParams = new Gcp.Compute.Inputs.InstanceBootDiskInitializeParamsArgs
{
Image = "projects/debian-cloud/global/images/debian-10-buster-v20210817",
},
},
NetworkInterfaces = new[]
{
new Gcp.Compute.Inputs.InstanceNetworkInterfaceArgs
{
Subnetwork = subnetwork.Name,
NetworkIp = "10.0.0.2",
AccessConfigs = new[]
{
new Gcp.Compute.Inputs.InstanceNetworkInterfaceAccessConfigArgs
{
NetworkTier = "PREMIUM",
},
},
},
},
});
var basicHub = new Gcp.NetworkConnectivity.Hub("basic_hub", new()
{
Name = "tf-test-hub_91980",
Description = "A sample hub",
Labels =
{
{ "label-two", "value-one" },
},
});
var primary = new Gcp.NetworkConnectivity.Spoke("primary", new()
{
Name = "tf-test-name_37118",
Location = "us-central1",
Description = "A sample spoke with a linked routher appliance instance",
Labels =
{
{ "label-one", "value-one" },
},
Hub = basicHub.Id,
LinkedRouterApplianceInstances = new Gcp.NetworkConnectivity.Inputs.SpokeLinkedRouterApplianceInstancesArgs
{
Instances = new[]
{
new Gcp.NetworkConnectivity.Inputs.SpokeLinkedRouterApplianceInstancesInstanceArgs
{
VirtualMachine = instance.SelfLink,
IpAddress = "10.0.0.2",
},
},
SiteToSiteDataTransfer = true,
IncludeImportRanges = new[]
{
"ALL_IPV4_RANGES",
},
},
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.gcp.compute.Network;
import com.pulumi.gcp.compute.NetworkArgs;
import com.pulumi.gcp.compute.Subnetwork;
import com.pulumi.gcp.compute.SubnetworkArgs;
import com.pulumi.gcp.compute.Instance;
import com.pulumi.gcp.compute.InstanceArgs;
import com.pulumi.gcp.compute.inputs.InstanceBootDiskArgs;
import com.pulumi.gcp.compute.inputs.InstanceBootDiskInitializeParamsArgs;
import com.pulumi.gcp.compute.inputs.InstanceNetworkInterfaceArgs;
import com.pulumi.gcp.networkconnectivity.Hub;
import com.pulumi.gcp.networkconnectivity.HubArgs;
import com.pulumi.gcp.networkconnectivity.Spoke;
import com.pulumi.gcp.networkconnectivity.SpokeArgs;
import com.pulumi.gcp.networkconnectivity.inputs.SpokeLinkedRouterApplianceInstancesArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;
public class App {
public static void main(String[] args) {
Pulumi.run(App::stack);
}
public static void stack(Context ctx) {
var network = new Network("network", NetworkArgs.builder()
.name("tf-test-network_75413")
.autoCreateSubnetworks(false)
.build());
var subnetwork = new Subnetwork("subnetwork", SubnetworkArgs.builder()
.name("tf-test-subnet_55138")
.ipCidrRange("10.0.0.0/28")
.region("us-central1")
.network(network.selfLink())
.build());
var instance = new Instance("instance", InstanceArgs.builder()
.name("tf-test-instance_37559")
.machineType("e2-medium")
.canIpForward(true)
.zone("us-central1-a")
.bootDisk(InstanceBootDiskArgs.builder()
.initializeParams(InstanceBootDiskInitializeParamsArgs.builder()
.image("projects/debian-cloud/global/images/debian-10-buster-v20210817")
.build())
.build())
.networkInterfaces(InstanceNetworkInterfaceArgs.builder()
.subnetwork(subnetwork.name())
.networkIp("10.0.0.2")
.accessConfigs(InstanceNetworkInterfaceAccessConfigArgs.builder()
.networkTier("PREMIUM")
.build())
.build())
.build());
var basicHub = new Hub("basicHub", HubArgs.builder()
.name("tf-test-hub_91980")
.description("A sample hub")
.labels(Map.of("label-two", "value-one"))
.build());
var primary = new Spoke("primary", SpokeArgs.builder()
.name("tf-test-name_37118")
.location("us-central1")
.description("A sample spoke with a linked routher appliance instance")
.labels(Map.of("label-one", "value-one"))
.hub(basicHub.id())
.linkedRouterApplianceInstances(SpokeLinkedRouterApplianceInstancesArgs.builder()
.instances(SpokeLinkedRouterApplianceInstancesInstanceArgs.builder()
.virtualMachine(instance.selfLink())
.ipAddress("10.0.0.2")
.build())
.siteToSiteDataTransfer(true)
.includeImportRanges("ALL_IPV4_RANGES")
.build())
.build());
}
}
resources:
network:
type: gcp:compute:Network
properties:
name: tf-test-network_75413
autoCreateSubnetworks: false
subnetwork:
type: gcp:compute:Subnetwork
properties:
name: tf-test-subnet_55138
ipCidrRange: 10.0.0.0/28
region: us-central1
network: ${network.selfLink}
instance:
type: gcp:compute:Instance
properties:
name: tf-test-instance_37559
machineType: e2-medium
canIpForward: true
zone: us-central1-a
bootDisk:
initializeParams:
image: projects/debian-cloud/global/images/debian-10-buster-v20210817
networkInterfaces:
- subnetwork: ${subnetwork.name}
networkIp: 10.0.0.2
accessConfigs:
- networkTier: PREMIUM
basicHub:
type: gcp:networkconnectivity:Hub
name: basic_hub
properties:
name: tf-test-hub_91980
description: A sample hub
labels:
label-two: value-one
primary:
type: gcp:networkconnectivity:Spoke
properties:
name: tf-test-name_37118
location: us-central1
description: A sample spoke with a linked routher appliance instance
labels:
label-one: value-one
hub: ${basicHub.id}
linkedRouterApplianceInstances:
instances:
- virtualMachine: ${instance.selfLink}
ipAddress: 10.0.0.2
siteToSiteDataTransfer: true
includeImportRanges:
- ALL_IPV4_RANGES
Network Connectivity Spoke Vpn Tunnel Basic
import * as pulumi from "@pulumi/pulumi";
import * as gcp from "@pulumi/gcp";
const basicHub = new gcp.networkconnectivity.Hub("basic_hub", {
name: "basic-hub1",
description: "A sample hub",
labels: {
"label-two": "value-one",
},
});
const network = new gcp.compute.Network("network", {
name: "basic-network",
autoCreateSubnetworks: false,
});
const subnetwork = new gcp.compute.Subnetwork("subnetwork", {
name: "basic-subnetwork",
ipCidrRange: "10.0.0.0/28",
region: "us-central1",
network: network.selfLink,
});
const gateway = new gcp.compute.HaVpnGateway("gateway", {
name: "vpn-gateway",
network: network.id,
});
const externalVpnGw = new gcp.compute.ExternalVpnGateway("external_vpn_gw", {
name: "external-vpn-gateway",
redundancyType: "SINGLE_IP_INTERNALLY_REDUNDANT",
description: "An externally managed VPN gateway",
interfaces: [{
id: 0,
ipAddress: "8.8.8.8",
}],
});
const router = new gcp.compute.Router("router", {
name: "external-vpn-gateway",
region: "us-central1",
network: network.name,
bgp: {
asn: 64514,
},
});
const tunnel1 = new gcp.compute.VPNTunnel("tunnel1", {
name: "tunnel1",
region: "us-central1",
vpnGateway: gateway.id,
peerExternalGateway: externalVpnGw.id,
peerExternalGatewayInterface: 0,
sharedSecret: "a secret message",
router: router.id,
vpnGatewayInterface: 0,
});
const tunnel2 = new gcp.compute.VPNTunnel("tunnel2", {
name: "tunnel2",
region: "us-central1",
vpnGateway: gateway.id,
peerExternalGateway: externalVpnGw.id,
peerExternalGatewayInterface: 0,
sharedSecret: "a secret message",
router: pulumi.interpolate` ${router.id}`,
vpnGatewayInterface: 1,
});
const routerInterface1 = new gcp.compute.RouterInterface("router_interface1", {
name: "router-interface1",
router: router.name,
region: "us-central1",
ipRange: "169.254.0.1/30",
vpnTunnel: tunnel1.name,
});
const routerPeer1 = new gcp.compute.RouterPeer("router_peer1", {
name: "router-peer1",
router: router.name,
region: "us-central1",
peerIpAddress: "169.254.0.2",
peerAsn: 64515,
advertisedRoutePriority: 100,
"interface": routerInterface1.name,
});
const routerInterface2 = new gcp.compute.RouterInterface("router_interface2", {
name: "router-interface2",
router: router.name,
region: "us-central1",
ipRange: "169.254.1.1/30",
vpnTunnel: tunnel2.name,
});
const routerPeer2 = new gcp.compute.RouterPeer("router_peer2", {
name: "router-peer2",
router: router.name,
region: "us-central1",
peerIpAddress: "169.254.1.2",
peerAsn: 64515,
advertisedRoutePriority: 100,
"interface": routerInterface2.name,
});
const tunnel1Spoke = new gcp.networkconnectivity.Spoke("tunnel1", {
name: "vpn-tunnel-1-spoke",
location: "us-central1",
description: "A sample spoke with a linked VPN Tunnel",
labels: {
"label-one": "value-one",
},
hub: basicHub.id,
linkedVpnTunnels: {
uris: [tunnel1.selfLink],
siteToSiteDataTransfer: true,
includeImportRanges: ["ALL_IPV4_RANGES"],
},
});
const tunnel2Spoke = new gcp.networkconnectivity.Spoke("tunnel2", {
name: "vpn-tunnel-2-spoke",
location: "us-central1",
description: "A sample spoke with a linked VPN Tunnel",
labels: {
"label-one": "value-one",
},
hub: basicHub.id,
linkedVpnTunnels: {
uris: [tunnel2.selfLink],
siteToSiteDataTransfer: true,
includeImportRanges: ["ALL_IPV4_RANGES"],
},
});
import pulumi
import pulumi_gcp as gcp
basic_hub = gcp.networkconnectivity.Hub("basic_hub",
name="basic-hub1",
description="A sample hub",
labels={
"label-two": "value-one",
})
network = gcp.compute.Network("network",
name="basic-network",
auto_create_subnetworks=False)
subnetwork = gcp.compute.Subnetwork("subnetwork",
name="basic-subnetwork",
ip_cidr_range="10.0.0.0/28",
region="us-central1",
network=network.self_link)
gateway = gcp.compute.HaVpnGateway("gateway",
name="vpn-gateway",
network=network.id)
external_vpn_gw = gcp.compute.ExternalVpnGateway("external_vpn_gw",
name="external-vpn-gateway",
redundancy_type="SINGLE_IP_INTERNALLY_REDUNDANT",
description="An externally managed VPN gateway",
interfaces=[{
"id": 0,
"ip_address": "8.8.8.8",
}])
router = gcp.compute.Router("router",
name="external-vpn-gateway",
region="us-central1",
network=network.name,
bgp={
"asn": 64514,
})
tunnel1 = gcp.compute.VPNTunnel("tunnel1",
name="tunnel1",
region="us-central1",
vpn_gateway=gateway.id,
peer_external_gateway=external_vpn_gw.id,
peer_external_gateway_interface=0,
shared_secret="a secret message",
router=router.id,
vpn_gateway_interface=0)
tunnel2 = gcp.compute.VPNTunnel("tunnel2",
name="tunnel2",
region="us-central1",
vpn_gateway=gateway.id,
peer_external_gateway=external_vpn_gw.id,
peer_external_gateway_interface=0,
shared_secret="a secret message",
router=router.id.apply(lambda id: f" {id}"),
vpn_gateway_interface=1)
router_interface1 = gcp.compute.RouterInterface("router_interface1",
name="router-interface1",
router=router.name,
region="us-central1",
ip_range="169.254.0.1/30",
vpn_tunnel=tunnel1.name)
router_peer1 = gcp.compute.RouterPeer("router_peer1",
name="router-peer1",
router=router.name,
region="us-central1",
peer_ip_address="169.254.0.2",
peer_asn=64515,
advertised_route_priority=100,
interface=router_interface1.name)
router_interface2 = gcp.compute.RouterInterface("router_interface2",
name="router-interface2",
router=router.name,
region="us-central1",
ip_range="169.254.1.1/30",
vpn_tunnel=tunnel2.name)
router_peer2 = gcp.compute.RouterPeer("router_peer2",
name="router-peer2",
router=router.name,
region="us-central1",
peer_ip_address="169.254.1.2",
peer_asn=64515,
advertised_route_priority=100,
interface=router_interface2.name)
tunnel1_spoke = gcp.networkconnectivity.Spoke("tunnel1",
name="vpn-tunnel-1-spoke",
location="us-central1",
description="A sample spoke with a linked VPN Tunnel",
labels={
"label-one": "value-one",
},
hub=basic_hub.id,
linked_vpn_tunnels={
"uris": [tunnel1.self_link],
"site_to_site_data_transfer": True,
"include_import_ranges": ["ALL_IPV4_RANGES"],
})
tunnel2_spoke = gcp.networkconnectivity.Spoke("tunnel2",
name="vpn-tunnel-2-spoke",
location="us-central1",
description="A sample spoke with a linked VPN Tunnel",
labels={
"label-one": "value-one",
},
hub=basic_hub.id,
linked_vpn_tunnels={
"uris": [tunnel2.self_link],
"site_to_site_data_transfer": True,
"include_import_ranges": ["ALL_IPV4_RANGES"],
})
package main
import (
"fmt"
"github.com/pulumi/pulumi-gcp/sdk/v8/go/gcp/compute"
"github.com/pulumi/pulumi-gcp/sdk/v8/go/gcp/networkconnectivity"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
basicHub, err := networkconnectivity.NewHub(ctx, "basic_hub", &networkconnectivity.HubArgs{
Name: pulumi.String("basic-hub1"),
Description: pulumi.String("A sample hub"),
Labels: pulumi.StringMap{
"label-two": pulumi.String("value-one"),
},
})
if err != nil {
return err
}
network, err := compute.NewNetwork(ctx, "network", &compute.NetworkArgs{
Name: pulumi.String("basic-network"),
AutoCreateSubnetworks: pulumi.Bool(false),
})
if err != nil {
return err
}
_, err = compute.NewSubnetwork(ctx, "subnetwork", &compute.SubnetworkArgs{
Name: pulumi.String("basic-subnetwork"),
IpCidrRange: pulumi.String("10.0.0.0/28"),
Region: pulumi.String("us-central1"),
Network: network.SelfLink,
})
if err != nil {
return err
}
gateway, err := compute.NewHaVpnGateway(ctx, "gateway", &compute.HaVpnGatewayArgs{
Name: pulumi.String("vpn-gateway"),
Network: network.ID(),
})
if err != nil {
return err
}
externalVpnGw, err := compute.NewExternalVpnGateway(ctx, "external_vpn_gw", &compute.ExternalVpnGatewayArgs{
Name: pulumi.String("external-vpn-gateway"),
RedundancyType: pulumi.String("SINGLE_IP_INTERNALLY_REDUNDANT"),
Description: pulumi.String("An externally managed VPN gateway"),
Interfaces: compute.ExternalVpnGatewayInterfaceArray{
&compute.ExternalVpnGatewayInterfaceArgs{
Id: pulumi.Int(0),
IpAddress: pulumi.String("8.8.8.8"),
},
},
})
if err != nil {
return err
}
router, err := compute.NewRouter(ctx, "router", &compute.RouterArgs{
Name: pulumi.String("external-vpn-gateway"),
Region: pulumi.String("us-central1"),
Network: network.Name,
Bgp: &compute.RouterBgpArgs{
Asn: pulumi.Int(64514),
},
})
if err != nil {
return err
}
tunnel1, err := compute.NewVPNTunnel(ctx, "tunnel1", &compute.VPNTunnelArgs{
Name: pulumi.String("tunnel1"),
Region: pulumi.String("us-central1"),
VpnGateway: gateway.ID(),
PeerExternalGateway: externalVpnGw.ID(),
PeerExternalGatewayInterface: pulumi.Int(0),
SharedSecret: pulumi.String("a secret message"),
Router: router.ID(),
VpnGatewayInterface: pulumi.Int(0),
})
if err != nil {
return err
}
tunnel2, err := compute.NewVPNTunnel(ctx, "tunnel2", &compute.VPNTunnelArgs{
Name: pulumi.String("tunnel2"),
Region: pulumi.String("us-central1"),
VpnGateway: gateway.ID(),
PeerExternalGateway: externalVpnGw.ID(),
PeerExternalGatewayInterface: pulumi.Int(0),
SharedSecret: pulumi.String("a secret message"),
Router: router.ID().ApplyT(func(id string) (string, error) {
return fmt.Sprintf(" %v", id), nil
}).(pulumi.StringOutput),
VpnGatewayInterface: pulumi.Int(1),
})
if err != nil {
return err
}
routerInterface1, err := compute.NewRouterInterface(ctx, "router_interface1", &compute.RouterInterfaceArgs{
Name: pulumi.String("router-interface1"),
Router: router.Name,
Region: pulumi.String("us-central1"),
IpRange: pulumi.String("169.254.0.1/30"),
VpnTunnel: tunnel1.Name,
})
if err != nil {
return err
}
_, err = compute.NewRouterPeer(ctx, "router_peer1", &compute.RouterPeerArgs{
Name: pulumi.String("router-peer1"),
Router: router.Name,
Region: pulumi.String("us-central1"),
PeerIpAddress: pulumi.String("169.254.0.2"),
PeerAsn: pulumi.Int(64515),
AdvertisedRoutePriority: pulumi.Int(100),
Interface: routerInterface1.Name,
})
if err != nil {
return err
}
routerInterface2, err := compute.NewRouterInterface(ctx, "router_interface2", &compute.RouterInterfaceArgs{
Name: pulumi.String("router-interface2"),
Router: router.Name,
Region: pulumi.String("us-central1"),
IpRange: pulumi.String("169.254.1.1/30"),
VpnTunnel: tunnel2.Name,
})
if err != nil {
return err
}
_, err = compute.NewRouterPeer(ctx, "router_peer2", &compute.RouterPeerArgs{
Name: pulumi.String("router-peer2"),
Router: router.Name,
Region: pulumi.String("us-central1"),
PeerIpAddress: pulumi.String("169.254.1.2"),
PeerAsn: pulumi.Int(64515),
AdvertisedRoutePriority: pulumi.Int(100),
Interface: routerInterface2.Name,
})
if err != nil {
return err
}
_, err = networkconnectivity.NewSpoke(ctx, "tunnel1", &networkconnectivity.SpokeArgs{
Name: pulumi.String("vpn-tunnel-1-spoke"),
Location: pulumi.String("us-central1"),
Description: pulumi.String("A sample spoke with a linked VPN Tunnel"),
Labels: pulumi.StringMap{
"label-one": pulumi.String("value-one"),
},
Hub: basicHub.ID(),
LinkedVpnTunnels: &networkconnectivity.SpokeLinkedVpnTunnelsArgs{
Uris: pulumi.StringArray{
tunnel1.SelfLink,
},
SiteToSiteDataTransfer: pulumi.Bool(true),
IncludeImportRanges: pulumi.StringArray{
pulumi.String("ALL_IPV4_RANGES"),
},
},
})
if err != nil {
return err
}
_, err = networkconnectivity.NewSpoke(ctx, "tunnel2", &networkconnectivity.SpokeArgs{
Name: pulumi.String("vpn-tunnel-2-spoke"),
Location: pulumi.String("us-central1"),
Description: pulumi.String("A sample spoke with a linked VPN Tunnel"),
Labels: pulumi.StringMap{
"label-one": pulumi.String("value-one"),
},
Hub: basicHub.ID(),
LinkedVpnTunnels: &networkconnectivity.SpokeLinkedVpnTunnelsArgs{
Uris: pulumi.StringArray{
tunnel2.SelfLink,
},
SiteToSiteDataTransfer: pulumi.Bool(true),
IncludeImportRanges: pulumi.StringArray{
pulumi.String("ALL_IPV4_RANGES"),
},
},
})
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Gcp = Pulumi.Gcp;
return await Deployment.RunAsync(() =>
{
var basicHub = new Gcp.NetworkConnectivity.Hub("basic_hub", new()
{
Name = "basic-hub1",
Description = "A sample hub",
Labels =
{
{ "label-two", "value-one" },
},
});
var network = new Gcp.Compute.Network("network", new()
{
Name = "basic-network",
AutoCreateSubnetworks = false,
});
var subnetwork = new Gcp.Compute.Subnetwork("subnetwork", new()
{
Name = "basic-subnetwork",
IpCidrRange = "10.0.0.0/28",
Region = "us-central1",
Network = network.SelfLink,
});
var gateway = new Gcp.Compute.HaVpnGateway("gateway", new()
{
Name = "vpn-gateway",
Network = network.Id,
});
var externalVpnGw = new Gcp.Compute.ExternalVpnGateway("external_vpn_gw", new()
{
Name = "external-vpn-gateway",
RedundancyType = "SINGLE_IP_INTERNALLY_REDUNDANT",
Description = "An externally managed VPN gateway",
Interfaces = new[]
{
new Gcp.Compute.Inputs.ExternalVpnGatewayInterfaceArgs
{
Id = 0,
IpAddress = "8.8.8.8",
},
},
});
var router = new Gcp.Compute.Router("router", new()
{
Name = "external-vpn-gateway",
Region = "us-central1",
Network = network.Name,
Bgp = new Gcp.Compute.Inputs.RouterBgpArgs
{
Asn = 64514,
},
});
var tunnel1 = new Gcp.Compute.VPNTunnel("tunnel1", new()
{
Name = "tunnel1",
Region = "us-central1",
VpnGateway = gateway.Id,
PeerExternalGateway = externalVpnGw.Id,
PeerExternalGatewayInterface = 0,
SharedSecret = "a secret message",
Router = router.Id,
VpnGatewayInterface = 0,
});
var tunnel2 = new Gcp.Compute.VPNTunnel("tunnel2", new()
{
Name = "tunnel2",
Region = "us-central1",
VpnGateway = gateway.Id,
PeerExternalGateway = externalVpnGw.Id,
PeerExternalGatewayInterface = 0,
SharedSecret = "a secret message",
Router = router.Id.Apply(id => $" {id}"),
VpnGatewayInterface = 1,
});
var routerInterface1 = new Gcp.Compute.RouterInterface("router_interface1", new()
{
Name = "router-interface1",
Router = router.Name,
Region = "us-central1",
IpRange = "169.254.0.1/30",
VpnTunnel = tunnel1.Name,
});
var routerPeer1 = new Gcp.Compute.RouterPeer("router_peer1", new()
{
Name = "router-peer1",
Router = router.Name,
Region = "us-central1",
PeerIpAddress = "169.254.0.2",
PeerAsn = 64515,
AdvertisedRoutePriority = 100,
Interface = routerInterface1.Name,
});
var routerInterface2 = new Gcp.Compute.RouterInterface("router_interface2", new()
{
Name = "router-interface2",
Router = router.Name,
Region = "us-central1",
IpRange = "169.254.1.1/30",
VpnTunnel = tunnel2.Name,
});
var routerPeer2 = new Gcp.Compute.RouterPeer("router_peer2", new()
{
Name = "router-peer2",
Router = router.Name,
Region = "us-central1",
PeerIpAddress = "169.254.1.2",
PeerAsn = 64515,
AdvertisedRoutePriority = 100,
Interface = routerInterface2.Name,
});
var tunnel1Spoke = new Gcp.NetworkConnectivity.Spoke("tunnel1", new()
{
Name = "vpn-tunnel-1-spoke",
Location = "us-central1",
Description = "A sample spoke with a linked VPN Tunnel",
Labels =
{
{ "label-one", "value-one" },
},
Hub = basicHub.Id,
LinkedVpnTunnels = new Gcp.NetworkConnectivity.Inputs.SpokeLinkedVpnTunnelsArgs
{
Uris = new[]
{
tunnel1.SelfLink,
},
SiteToSiteDataTransfer = true,
IncludeImportRanges = new[]
{
"ALL_IPV4_RANGES",
},
},
});
var tunnel2Spoke = new Gcp.NetworkConnectivity.Spoke("tunnel2", new()
{
Name = "vpn-tunnel-2-spoke",
Location = "us-central1",
Description = "A sample spoke with a linked VPN Tunnel",
Labels =
{
{ "label-one", "value-one" },
},
Hub = basicHub.Id,
LinkedVpnTunnels = new Gcp.NetworkConnectivity.Inputs.SpokeLinkedVpnTunnelsArgs
{
Uris = new[]
{
tunnel2.SelfLink,
},
SiteToSiteDataTransfer = true,
IncludeImportRanges = new[]
{
"ALL_IPV4_RANGES",
},
},
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.gcp.networkconnectivity.Hub;
import com.pulumi.gcp.networkconnectivity.HubArgs;
import com.pulumi.gcp.compute.Network;
import com.pulumi.gcp.compute.NetworkArgs;
import com.pulumi.gcp.compute.Subnetwork;
import com.pulumi.gcp.compute.SubnetworkArgs;
import com.pulumi.gcp.compute.HaVpnGateway;
import com.pulumi.gcp.compute.HaVpnGatewayArgs;
import com.pulumi.gcp.compute.ExternalVpnGateway;
import com.pulumi.gcp.compute.ExternalVpnGatewayArgs;
import com.pulumi.gcp.compute.inputs.ExternalVpnGatewayInterfaceArgs;
import com.pulumi.gcp.compute.Router;
import com.pulumi.gcp.compute.RouterArgs;
import com.pulumi.gcp.compute.inputs.RouterBgpArgs;
import com.pulumi.gcp.compute.VPNTunnel;
import com.pulumi.gcp.compute.VPNTunnelArgs;
import com.pulumi.gcp.compute.RouterInterface;
import com.pulumi.gcp.compute.RouterInterfaceArgs;
import com.pulumi.gcp.compute.RouterPeer;
import com.pulumi.gcp.compute.RouterPeerArgs;
import com.pulumi.gcp.networkconnectivity.Spoke;
import com.pulumi.gcp.networkconnectivity.SpokeArgs;
import com.pulumi.gcp.networkconnectivity.inputs.SpokeLinkedVpnTunnelsArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;
public class App {
public static void main(String[] args) {
Pulumi.run(App::stack);
}
public static void stack(Context ctx) {
var basicHub = new Hub("basicHub", HubArgs.builder()
.name("basic-hub1")
.description("A sample hub")
.labels(Map.of("label-two", "value-one"))
.build());
var network = new Network("network", NetworkArgs.builder()
.name("basic-network")
.autoCreateSubnetworks(false)
.build());
var subnetwork = new Subnetwork("subnetwork", SubnetworkArgs.builder()
.name("basic-subnetwork")
.ipCidrRange("10.0.0.0/28")
.region("us-central1")
.network(network.selfLink())
.build());
var gateway = new HaVpnGateway("gateway", HaVpnGatewayArgs.builder()
.name("vpn-gateway")
.network(network.id())
.build());
var externalVpnGw = new ExternalVpnGateway("externalVpnGw", ExternalVpnGatewayArgs.builder()
.name("external-vpn-gateway")
.redundancyType("SINGLE_IP_INTERNALLY_REDUNDANT")
.description("An externally managed VPN gateway")
.interfaces(ExternalVpnGatewayInterfaceArgs.builder()
.id(0)
.ipAddress("8.8.8.8")
.build())
.build());
var router = new Router("router", RouterArgs.builder()
.name("external-vpn-gateway")
.region("us-central1")
.network(network.name())
.bgp(RouterBgpArgs.builder()
.asn(64514)
.build())
.build());
var tunnel1 = new VPNTunnel("tunnel1", VPNTunnelArgs.builder()
.name("tunnel1")
.region("us-central1")
.vpnGateway(gateway.id())
.peerExternalGateway(externalVpnGw.id())
.peerExternalGatewayInterface(0)
.sharedSecret("a secret message")
.router(router.id())
.vpnGatewayInterface(0)
.build());
var tunnel2 = new VPNTunnel("tunnel2", VPNTunnelArgs.builder()
.name("tunnel2")
.region("us-central1")
.vpnGateway(gateway.id())
.peerExternalGateway(externalVpnGw.id())
.peerExternalGatewayInterface(0)
.sharedSecret("a secret message")
.router(router.id().applyValue(id -> String.format(" %s", id)))
.vpnGatewayInterface(1)
.build());
var routerInterface1 = new RouterInterface("routerInterface1", RouterInterfaceArgs.builder()
.name("router-interface1")
.router(router.name())
.region("us-central1")
.ipRange("169.254.0.1/30")
.vpnTunnel(tunnel1.name())
.build());
var routerPeer1 = new RouterPeer("routerPeer1", RouterPeerArgs.builder()
.name("router-peer1")
.router(router.name())
.region("us-central1")
.peerIpAddress("169.254.0.2")
.peerAsn(64515)
.advertisedRoutePriority(100)
.interface_(routerInterface1.name())
.build());
var routerInterface2 = new RouterInterface("routerInterface2", RouterInterfaceArgs.builder()
.name("router-interface2")
.router(router.name())
.region("us-central1")
.ipRange("169.254.1.1/30")
.vpnTunnel(tunnel2.name())
.build());
var routerPeer2 = new RouterPeer("routerPeer2", RouterPeerArgs.builder()
.name("router-peer2")
.router(router.name())
.region("us-central1")
.peerIpAddress("169.254.1.2")
.peerAsn(64515)
.advertisedRoutePriority(100)
.interface_(routerInterface2.name())
.build());
var tunnel1Spoke = new Spoke("tunnel1Spoke", SpokeArgs.builder()
.name("vpn-tunnel-1-spoke")
.location("us-central1")
.description("A sample spoke with a linked VPN Tunnel")
.labels(Map.of("label-one", "value-one"))
.hub(basicHub.id())
.linkedVpnTunnels(SpokeLinkedVpnTunnelsArgs.builder()
.uris(tunnel1.selfLink())
.siteToSiteDataTransfer(true)
.includeImportRanges("ALL_IPV4_RANGES")
.build())
.build());
var tunnel2Spoke = new Spoke("tunnel2Spoke", SpokeArgs.builder()
.name("vpn-tunnel-2-spoke")
.location("us-central1")
.description("A sample spoke with a linked VPN Tunnel")
.labels(Map.of("label-one", "value-one"))
.hub(basicHub.id())
.linkedVpnTunnels(SpokeLinkedVpnTunnelsArgs.builder()
.uris(tunnel2.selfLink())
.siteToSiteDataTransfer(true)
.includeImportRanges("ALL_IPV4_RANGES")
.build())
.build());
}
}
resources:
basicHub:
type: gcp:networkconnectivity:Hub
name: basic_hub
properties:
name: basic-hub1
description: A sample hub
labels:
label-two: value-one
network:
type: gcp:compute:Network
properties:
name: basic-network
autoCreateSubnetworks: false
subnetwork:
type: gcp:compute:Subnetwork
properties:
name: basic-subnetwork
ipCidrRange: 10.0.0.0/28
region: us-central1
network: ${network.selfLink}
gateway:
type: gcp:compute:HaVpnGateway
properties:
name: vpn-gateway
network: ${network.id}
externalVpnGw:
type: gcp:compute:ExternalVpnGateway
name: external_vpn_gw
properties:
name: external-vpn-gateway
redundancyType: SINGLE_IP_INTERNALLY_REDUNDANT
description: An externally managed VPN gateway
interfaces:
- id: 0
ipAddress: 8.8.8.8
router:
type: gcp:compute:Router
properties:
name: external-vpn-gateway
region: us-central1
network: ${network.name}
bgp:
asn: 64514
tunnel1:
type: gcp:compute:VPNTunnel
properties:
name: tunnel1
region: us-central1
vpnGateway: ${gateway.id}
peerExternalGateway: ${externalVpnGw.id}
peerExternalGatewayInterface: 0
sharedSecret: a secret message
router: ${router.id}
vpnGatewayInterface: 0
tunnel2:
type: gcp:compute:VPNTunnel
properties:
name: tunnel2
region: us-central1
vpnGateway: ${gateway.id}
peerExternalGateway: ${externalVpnGw.id}
peerExternalGatewayInterface: 0
sharedSecret: a secret message
router: ' ${router.id}'
vpnGatewayInterface: 1
routerInterface1:
type: gcp:compute:RouterInterface
name: router_interface1
properties:
name: router-interface1
router: ${router.name}
region: us-central1
ipRange: 169.254.0.1/30
vpnTunnel: ${tunnel1.name}
routerPeer1:
type: gcp:compute:RouterPeer
name: router_peer1
properties:
name: router-peer1
router: ${router.name}
region: us-central1
peerIpAddress: 169.254.0.2
peerAsn: 64515
advertisedRoutePriority: 100
interface: ${routerInterface1.name}
routerInterface2:
type: gcp:compute:RouterInterface
name: router_interface2
properties:
name: router-interface2
router: ${router.name}
region: us-central1
ipRange: 169.254.1.1/30
vpnTunnel: ${tunnel2.name}
routerPeer2:
type: gcp:compute:RouterPeer
name: router_peer2
properties:
name: router-peer2
router: ${router.name}
region: us-central1
peerIpAddress: 169.254.1.2
peerAsn: 64515
advertisedRoutePriority: 100
interface: ${routerInterface2.name}
tunnel1Spoke:
type: gcp:networkconnectivity:Spoke
name: tunnel1
properties:
name: vpn-tunnel-1-spoke
location: us-central1
description: A sample spoke with a linked VPN Tunnel
labels:
label-one: value-one
hub: ${basicHub.id}
linkedVpnTunnels:
uris:
- ${tunnel1.selfLink}
siteToSiteDataTransfer: true
includeImportRanges:
- ALL_IPV4_RANGES
tunnel2Spoke:
type: gcp:networkconnectivity:Spoke
name: tunnel2
properties:
name: vpn-tunnel-2-spoke
location: us-central1
description: A sample spoke with a linked VPN Tunnel
labels:
label-one: value-one
hub: ${basicHub.id}
linkedVpnTunnels:
uris:
- ${tunnel2.selfLink}
siteToSiteDataTransfer: true
includeImportRanges:
- ALL_IPV4_RANGES
Network Connectivity Spoke Interconnect Attachment Basic
import * as pulumi from "@pulumi/pulumi";
import * as gcp from "@pulumi/gcp";
const basicHub = new gcp.networkconnectivity.Hub("basic_hub", {
name: "basic-hub1",
description: "A sample hub",
labels: {
"label-two": "value-one",
},
});
const network = new gcp.compute.Network("network", {
name: "basic-network",
autoCreateSubnetworks: false,
});
const router = new gcp.compute.Router("router", {
name: "external-vpn-gateway",
region: "us-central1",
network: network.name,
bgp: {
asn: 16550,
},
});
const interconnect_attachment = new gcp.compute.InterconnectAttachment("interconnect-attachment", {
name: "partner-interconnect1",
edgeAvailabilityDomain: "AVAILABILITY_DOMAIN_1",
type: "PARTNER",
router: router.id,
mtu: "1500",
region: "us-central1",
});
const primary = new gcp.networkconnectivity.Spoke("primary", {
name: "interconnect-attachment-spoke",
location: "us-central1",
description: "A sample spoke with a linked Interconnect Attachment",
labels: {
"label-one": "value-one",
},
hub: basicHub.id,
linkedInterconnectAttachments: {
uris: [interconnect_attachment.selfLink],
siteToSiteDataTransfer: true,
includeImportRanges: ["ALL_IPV4_RANGES"],
},
});
import pulumi
import pulumi_gcp as gcp
basic_hub = gcp.networkconnectivity.Hub("basic_hub",
name="basic-hub1",
description="A sample hub",
labels={
"label-two": "value-one",
})
network = gcp.compute.Network("network",
name="basic-network",
auto_create_subnetworks=False)
router = gcp.compute.Router("router",
name="external-vpn-gateway",
region="us-central1",
network=network.name,
bgp={
"asn": 16550,
})
interconnect_attachment = gcp.compute.InterconnectAttachment("interconnect-attachment",
name="partner-interconnect1",
edge_availability_domain="AVAILABILITY_DOMAIN_1",
type="PARTNER",
router=router.id,
mtu="1500",
region="us-central1")
primary = gcp.networkconnectivity.Spoke("primary",
name="interconnect-attachment-spoke",
location="us-central1",
description="A sample spoke with a linked Interconnect Attachment",
labels={
"label-one": "value-one",
},
hub=basic_hub.id,
linked_interconnect_attachments={
"uris": [interconnect_attachment.self_link],
"site_to_site_data_transfer": True,
"include_import_ranges": ["ALL_IPV4_RANGES"],
})
package main
import (
"github.com/pulumi/pulumi-gcp/sdk/v8/go/gcp/compute"
"github.com/pulumi/pulumi-gcp/sdk/v8/go/gcp/networkconnectivity"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
basicHub, err := networkconnectivity.NewHub(ctx, "basic_hub", &networkconnectivity.HubArgs{
Name: pulumi.String("basic-hub1"),
Description: pulumi.String("A sample hub"),
Labels: pulumi.StringMap{
"label-two": pulumi.String("value-one"),
},
})
if err != nil {
return err
}
network, err := compute.NewNetwork(ctx, "network", &compute.NetworkArgs{
Name: pulumi.String("basic-network"),
AutoCreateSubnetworks: pulumi.Bool(false),
})
if err != nil {
return err
}
router, err := compute.NewRouter(ctx, "router", &compute.RouterArgs{
Name: pulumi.String("external-vpn-gateway"),
Region: pulumi.String("us-central1"),
Network: network.Name,
Bgp: &compute.RouterBgpArgs{
Asn: pulumi.Int(16550),
},
})
if err != nil {
return err
}
_, err = compute.NewInterconnectAttachment(ctx, "interconnect-attachment", &compute.InterconnectAttachmentArgs{
Name: pulumi.String("partner-interconnect1"),
EdgeAvailabilityDomain: pulumi.String("AVAILABILITY_DOMAIN_1"),
Type: pulumi.String("PARTNER"),
Router: router.ID(),
Mtu: pulumi.String("1500"),
Region: pulumi.String("us-central1"),
})
if err != nil {
return err
}
_, err = networkconnectivity.NewSpoke(ctx, "primary", &networkconnectivity.SpokeArgs{
Name: pulumi.String("interconnect-attachment-spoke"),
Location: pulumi.String("us-central1"),
Description: pulumi.String("A sample spoke with a linked Interconnect Attachment"),
Labels: pulumi.StringMap{
"label-one": pulumi.String("value-one"),
},
Hub: basicHub.ID(),
LinkedInterconnectAttachments: &networkconnectivity.SpokeLinkedInterconnectAttachmentsArgs{
Uris: pulumi.StringArray{
interconnect_attachment.SelfLink,
},
SiteToSiteDataTransfer: pulumi.Bool(true),
IncludeImportRanges: pulumi.StringArray{
pulumi.String("ALL_IPV4_RANGES"),
},
},
})
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Gcp = Pulumi.Gcp;
return await Deployment.RunAsync(() =>
{
var basicHub = new Gcp.NetworkConnectivity.Hub("basic_hub", new()
{
Name = "basic-hub1",
Description = "A sample hub",
Labels =
{
{ "label-two", "value-one" },
},
});
var network = new Gcp.Compute.Network("network", new()
{
Name = "basic-network",
AutoCreateSubnetworks = false,
});
var router = new Gcp.Compute.Router("router", new()
{
Name = "external-vpn-gateway",
Region = "us-central1",
Network = network.Name,
Bgp = new Gcp.Compute.Inputs.RouterBgpArgs
{
Asn = 16550,
},
});
var interconnect_attachment = new Gcp.Compute.InterconnectAttachment("interconnect-attachment", new()
{
Name = "partner-interconnect1",
EdgeAvailabilityDomain = "AVAILABILITY_DOMAIN_1",
Type = "PARTNER",
Router = router.Id,
Mtu = "1500",
Region = "us-central1",
});
var primary = new Gcp.NetworkConnectivity.Spoke("primary", new()
{
Name = "interconnect-attachment-spoke",
Location = "us-central1",
Description = "A sample spoke with a linked Interconnect Attachment",
Labels =
{
{ "label-one", "value-one" },
},
Hub = basicHub.Id,
LinkedInterconnectAttachments = new Gcp.NetworkConnectivity.Inputs.SpokeLinkedInterconnectAttachmentsArgs
{
Uris = new[]
{
interconnect_attachment.SelfLink,
},
SiteToSiteDataTransfer = true,
IncludeImportRanges = new[]
{
"ALL_IPV4_RANGES",
},
},
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.gcp.networkconnectivity.Hub;
import com.pulumi.gcp.networkconnectivity.HubArgs;
import com.pulumi.gcp.compute.Network;
import com.pulumi.gcp.compute.NetworkArgs;
import com.pulumi.gcp.compute.Router;
import com.pulumi.gcp.compute.RouterArgs;
import com.pulumi.gcp.compute.inputs.RouterBgpArgs;
import com.pulumi.gcp.compute.InterconnectAttachment;
import com.pulumi.gcp.compute.InterconnectAttachmentArgs;
import com.pulumi.gcp.networkconnectivity.Spoke;
import com.pulumi.gcp.networkconnectivity.SpokeArgs;
import com.pulumi.gcp.networkconnectivity.inputs.SpokeLinkedInterconnectAttachmentsArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;
public class App {
public static void main(String[] args) {
Pulumi.run(App::stack);
}
public static void stack(Context ctx) {
var basicHub = new Hub("basicHub", HubArgs.builder()
.name("basic-hub1")
.description("A sample hub")
.labels(Map.of("label-two", "value-one"))
.build());
var network = new Network("network", NetworkArgs.builder()
.name("basic-network")
.autoCreateSubnetworks(false)
.build());
var router = new Router("router", RouterArgs.builder()
.name("external-vpn-gateway")
.region("us-central1")
.network(network.name())
.bgp(RouterBgpArgs.builder()
.asn(16550)
.build())
.build());
var interconnect_attachment = new InterconnectAttachment("interconnect-attachment", InterconnectAttachmentArgs.builder()
.name("partner-interconnect1")
.edgeAvailabilityDomain("AVAILABILITY_DOMAIN_1")
.type("PARTNER")
.router(router.id())
.mtu(1500)
.region("us-central1")
.build());
var primary = new Spoke("primary", SpokeArgs.builder()
.name("interconnect-attachment-spoke")
.location("us-central1")
.description("A sample spoke with a linked Interconnect Attachment")
.labels(Map.of("label-one", "value-one"))
.hub(basicHub.id())
.linkedInterconnectAttachments(SpokeLinkedInterconnectAttachmentsArgs.builder()
.uris(interconnect_attachment.selfLink())
.siteToSiteDataTransfer(true)
.includeImportRanges("ALL_IPV4_RANGES")
.build())
.build());
}
}
resources:
basicHub:
type: gcp:networkconnectivity:Hub
name: basic_hub
properties:
name: basic-hub1
description: A sample hub
labels:
label-two: value-one
network:
type: gcp:compute:Network
properties:
name: basic-network
autoCreateSubnetworks: false
router:
type: gcp:compute:Router
properties:
name: external-vpn-gateway
region: us-central1
network: ${network.name}
bgp:
asn: 16550
interconnect-attachment:
type: gcp:compute:InterconnectAttachment
properties:
name: partner-interconnect1
edgeAvailabilityDomain: AVAILABILITY_DOMAIN_1
type: PARTNER
router: ${router.id}
mtu: 1500
region: us-central1
primary:
type: gcp:networkconnectivity:Spoke
properties:
name: interconnect-attachment-spoke
location: us-central1
description: A sample spoke with a linked Interconnect Attachment
labels:
label-one: value-one
hub: ${basicHub.id}
linkedInterconnectAttachments:
uris:
- ${["interconnect-attachment"].selfLink}
siteToSiteDataTransfer: true
includeImportRanges:
- ALL_IPV4_RANGES
Network Connectivity Spoke Linked Producer Vpc Network Basic
import * as pulumi from "@pulumi/pulumi";
import * as gcp from "@pulumi/gcp";
const network = new gcp.compute.Network("network", {
name: "net-spoke",
autoCreateSubnetworks: false,
});
const address = new gcp.compute.GlobalAddress("address", {
name: "test-address",
purpose: "VPC_PEERING",
addressType: "INTERNAL",
prefixLength: 16,
network: network.id,
});
const peering = new gcp.servicenetworking.Connection("peering", {
network: network.id,
service: "servicenetworking.googleapis.com",
reservedPeeringRanges: [address.name],
});
const basicHub = new gcp.networkconnectivity.Hub("basic_hub", {name: "hub-basic"});
const linkedVpcSpoke = new gcp.networkconnectivity.Spoke("linked_vpc_spoke", {
name: "vpc-spoke",
location: "global",
hub: basicHub.id,
linkedVpcNetwork: {
uri: network.selfLink,
},
});
const primary = new gcp.networkconnectivity.Spoke("primary", {
name: "producer-spoke",
location: "global",
description: "A sample spoke with a linked router appliance instance",
labels: {
"label-one": "value-one",
},
hub: basicHub.id,
linkedProducerVpcNetwork: {
network: network.name,
peering: peering.peering,
excludeExportRanges: [
"198.51.100.0/24",
"10.10.0.0/16",
],
},
}, {
dependsOn: [linkedVpcSpoke],
});
import pulumi
import pulumi_gcp as gcp
network = gcp.compute.Network("network",
name="net-spoke",
auto_create_subnetworks=False)
address = gcp.compute.GlobalAddress("address",
name="test-address",
purpose="VPC_PEERING",
address_type="INTERNAL",
prefix_length=16,
network=network.id)
peering = gcp.servicenetworking.Connection("peering",
network=network.id,
service="servicenetworking.googleapis.com",
reserved_peering_ranges=[address.name])
basic_hub = gcp.networkconnectivity.Hub("basic_hub", name="hub-basic")
linked_vpc_spoke = gcp.networkconnectivity.Spoke("linked_vpc_spoke",
name="vpc-spoke",
location="global",
hub=basic_hub.id,
linked_vpc_network={
"uri": network.self_link,
})
primary = gcp.networkconnectivity.Spoke("primary",
name="producer-spoke",
location="global",
description="A sample spoke with a linked router appliance instance",
labels={
"label-one": "value-one",
},
hub=basic_hub.id,
linked_producer_vpc_network={
"network": network.name,
"peering": peering.peering,
"exclude_export_ranges": [
"198.51.100.0/24",
"10.10.0.0/16",
],
},
opts = pulumi.ResourceOptions(depends_on=[linked_vpc_spoke]))
package main
import (
"github.com/pulumi/pulumi-gcp/sdk/v8/go/gcp/compute"
"github.com/pulumi/pulumi-gcp/sdk/v8/go/gcp/networkconnectivity"
"github.com/pulumi/pulumi-gcp/sdk/v8/go/gcp/servicenetworking"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
network, err := compute.NewNetwork(ctx, "network", &compute.NetworkArgs{
Name: pulumi.String("net-spoke"),
AutoCreateSubnetworks: pulumi.Bool(false),
})
if err != nil {
return err
}
address, err := compute.NewGlobalAddress(ctx, "address", &compute.GlobalAddressArgs{
Name: pulumi.String("test-address"),
Purpose: pulumi.String("VPC_PEERING"),
AddressType: pulumi.String("INTERNAL"),
PrefixLength: pulumi.Int(16),
Network: network.ID(),
})
if err != nil {
return err
}
peering, err := servicenetworking.NewConnection(ctx, "peering", &servicenetworking.ConnectionArgs{
Network: network.ID(),
Service: pulumi.String("servicenetworking.googleapis.com"),
ReservedPeeringRanges: pulumi.StringArray{
address.Name,
},
})
if err != nil {
return err
}
basicHub, err := networkconnectivity.NewHub(ctx, "basic_hub", &networkconnectivity.HubArgs{
Name: pulumi.String("hub-basic"),
})
if err != nil {
return err
}
linkedVpcSpoke, err := networkconnectivity.NewSpoke(ctx, "linked_vpc_spoke", &networkconnectivity.SpokeArgs{
Name: pulumi.String("vpc-spoke"),
Location: pulumi.String("global"),
Hub: basicHub.ID(),
LinkedVpcNetwork: &networkconnectivity.SpokeLinkedVpcNetworkArgs{
Uri: network.SelfLink,
},
})
if err != nil {
return err
}
_, err = networkconnectivity.NewSpoke(ctx, "primary", &networkconnectivity.SpokeArgs{
Name: pulumi.String("producer-spoke"),
Location: pulumi.String("global"),
Description: pulumi.String("A sample spoke with a linked router appliance instance"),
Labels: pulumi.StringMap{
"label-one": pulumi.String("value-one"),
},
Hub: basicHub.ID(),
LinkedProducerVpcNetwork: &networkconnectivity.SpokeLinkedProducerVpcNetworkArgs{
Network: network.Name,
Peering: peering.Peering,
ExcludeExportRanges: pulumi.StringArray{
pulumi.String("198.51.100.0/24"),
pulumi.String("10.10.0.0/16"),
},
},
}, pulumi.DependsOn([]pulumi.Resource{
linkedVpcSpoke,
}))
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Gcp = Pulumi.Gcp;
return await Deployment.RunAsync(() =>
{
var network = new Gcp.Compute.Network("network", new()
{
Name = "net-spoke",
AutoCreateSubnetworks = false,
});
var address = new Gcp.Compute.GlobalAddress("address", new()
{
Name = "test-address",
Purpose = "VPC_PEERING",
AddressType = "INTERNAL",
PrefixLength = 16,
Network = network.Id,
});
var peering = new Gcp.ServiceNetworking.Connection("peering", new()
{
Network = network.Id,
Service = "servicenetworking.googleapis.com",
ReservedPeeringRanges = new[]
{
address.Name,
},
});
var basicHub = new Gcp.NetworkConnectivity.Hub("basic_hub", new()
{
Name = "hub-basic",
});
var linkedVpcSpoke = new Gcp.NetworkConnectivity.Spoke("linked_vpc_spoke", new()
{
Name = "vpc-spoke",
Location = "global",
Hub = basicHub.Id,
LinkedVpcNetwork = new Gcp.NetworkConnectivity.Inputs.SpokeLinkedVpcNetworkArgs
{
Uri = network.SelfLink,
},
});
var primary = new Gcp.NetworkConnectivity.Spoke("primary", new()
{
Name = "producer-spoke",
Location = "global",
Description = "A sample spoke with a linked router appliance instance",
Labels =
{
{ "label-one", "value-one" },
},
Hub = basicHub.Id,
LinkedProducerVpcNetwork = new Gcp.NetworkConnectivity.Inputs.SpokeLinkedProducerVpcNetworkArgs
{
Network = network.Name,
Peering = peering.Peering,
ExcludeExportRanges = new[]
{
"198.51.100.0/24",
"10.10.0.0/16",
},
},
}, new CustomResourceOptions
{
DependsOn =
{
linkedVpcSpoke,
},
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.gcp.compute.Network;
import com.pulumi.gcp.compute.NetworkArgs;
import com.pulumi.gcp.compute.GlobalAddress;
import com.pulumi.gcp.compute.GlobalAddressArgs;
import com.pulumi.gcp.servicenetworking.Connection;
import com.pulumi.gcp.servicenetworking.ConnectionArgs;
import com.pulumi.gcp.networkconnectivity.Hub;
import com.pulumi.gcp.networkconnectivity.HubArgs;
import com.pulumi.gcp.networkconnectivity.Spoke;
import com.pulumi.gcp.networkconnectivity.SpokeArgs;
import com.pulumi.gcp.networkconnectivity.inputs.SpokeLinkedVpcNetworkArgs;
import com.pulumi.gcp.networkconnectivity.inputs.SpokeLinkedProducerVpcNetworkArgs;
import com.pulumi.resources.CustomResourceOptions;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;
public class App {
public static void main(String[] args) {
Pulumi.run(App::stack);
}
public static void stack(Context ctx) {
var network = new Network("network", NetworkArgs.builder()
.name("net-spoke")
.autoCreateSubnetworks(false)
.build());
var address = new GlobalAddress("address", GlobalAddressArgs.builder()
.name("test-address")
.purpose("VPC_PEERING")
.addressType("INTERNAL")
.prefixLength(16)
.network(network.id())
.build());
var peering = new Connection("peering", ConnectionArgs.builder()
.network(network.id())
.service("servicenetworking.googleapis.com")
.reservedPeeringRanges(address.name())
.build());
var basicHub = new Hub("basicHub", HubArgs.builder()
.name("hub-basic")
.build());
var linkedVpcSpoke = new Spoke("linkedVpcSpoke", SpokeArgs.builder()
.name("vpc-spoke")
.location("global")
.hub(basicHub.id())
.linkedVpcNetwork(SpokeLinkedVpcNetworkArgs.builder()
.uri(network.selfLink())
.build())
.build());
var primary = new Spoke("primary", SpokeArgs.builder()
.name("producer-spoke")
.location("global")
.description("A sample spoke with a linked router appliance instance")
.labels(Map.of("label-one", "value-one"))
.hub(basicHub.id())
.linkedProducerVpcNetwork(SpokeLinkedProducerVpcNetworkArgs.builder()
.network(network.name())
.peering(peering.peering())
.excludeExportRanges(
"198.51.100.0/24",
"10.10.0.0/16")
.build())
.build(), CustomResourceOptions.builder()
.dependsOn(linkedVpcSpoke)
.build());
}
}
resources:
network:
type: gcp:compute:Network
properties:
name: net-spoke
autoCreateSubnetworks: false
address:
type: gcp:compute:GlobalAddress
properties:
name: test-address
purpose: VPC_PEERING
addressType: INTERNAL
prefixLength: 16
network: ${network.id}
peering:
type: gcp:servicenetworking:Connection
properties:
network: ${network.id}
service: servicenetworking.googleapis.com
reservedPeeringRanges:
- ${address.name}
basicHub:
type: gcp:networkconnectivity:Hub
name: basic_hub
properties:
name: hub-basic
linkedVpcSpoke:
type: gcp:networkconnectivity:Spoke
name: linked_vpc_spoke
properties:
name: vpc-spoke
location: global
hub: ${basicHub.id}
linkedVpcNetwork:
uri: ${network.selfLink}
primary:
type: gcp:networkconnectivity:Spoke
properties:
name: producer-spoke
location: global
description: A sample spoke with a linked router appliance instance
labels:
label-one: value-one
hub: ${basicHub.id}
linkedProducerVpcNetwork:
network: ${network.name}
peering: ${peering.peering}
excludeExportRanges:
- 198.51.100.0/24
- 10.10.0.0/16
options:
dependson:
- ${linkedVpcSpoke}
Create Spoke Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new Spoke(name: string, args: SpokeArgs, opts?: CustomResourceOptions);
@overload
def Spoke(resource_name: str,
args: SpokeArgs,
opts: Optional[ResourceOptions] = None)
@overload
def Spoke(resource_name: str,
opts: Optional[ResourceOptions] = None,
hub: Optional[str] = None,
location: Optional[str] = None,
description: Optional[str] = None,
labels: Optional[Mapping[str, str]] = None,
linked_interconnect_attachments: Optional[SpokeLinkedInterconnectAttachmentsArgs] = None,
linked_producer_vpc_network: Optional[SpokeLinkedProducerVpcNetworkArgs] = None,
linked_router_appliance_instances: Optional[SpokeLinkedRouterApplianceInstancesArgs] = None,
linked_vpc_network: Optional[SpokeLinkedVpcNetworkArgs] = None,
linked_vpn_tunnels: Optional[SpokeLinkedVpnTunnelsArgs] = None,
name: Optional[str] = None,
project: Optional[str] = None)
func NewSpoke(ctx *Context, name string, args SpokeArgs, opts ...ResourceOption) (*Spoke, error)
public Spoke(string name, SpokeArgs args, CustomResourceOptions? opts = null)
type: gcp:networkconnectivity:Spoke
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.
Parameters
- name string
- The unique name of the resource.
- args SpokeArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- resource_name str
- The unique name of the resource.
- args SpokeArgs
- The arguments to resource properties.
- opts ResourceOptions
- Bag of options to control resource's behavior.
- ctx Context
- Context object for the current deployment.
- name string
- The unique name of the resource.
- args SpokeArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args SpokeArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args SpokeArgs
- The arguments to resource properties.
- options CustomResourceOptions
- Bag of options to control resource's behavior.
Constructor example
The following reference example uses placeholder values for all input properties.
var spokeResource = new Gcp.NetworkConnectivity.Spoke("spokeResource", new()
{
Hub = "string",
Location = "string",
Description = "string",
Labels =
{
{ "string", "string" },
},
LinkedInterconnectAttachments = new Gcp.NetworkConnectivity.Inputs.SpokeLinkedInterconnectAttachmentsArgs
{
SiteToSiteDataTransfer = false,
Uris = new[]
{
"string",
},
IncludeImportRanges = new[]
{
"string",
},
},
LinkedProducerVpcNetwork = new Gcp.NetworkConnectivity.Inputs.SpokeLinkedProducerVpcNetworkArgs
{
Network = "string",
Peering = "string",
ExcludeExportRanges = new[]
{
"string",
},
IncludeExportRanges = new[]
{
"string",
},
ProducerNetwork = "string",
},
LinkedRouterApplianceInstances = new Gcp.NetworkConnectivity.Inputs.SpokeLinkedRouterApplianceInstancesArgs
{
Instances = new[]
{
new Gcp.NetworkConnectivity.Inputs.SpokeLinkedRouterApplianceInstancesInstanceArgs
{
IpAddress = "string",
VirtualMachine = "string",
},
},
SiteToSiteDataTransfer = false,
IncludeImportRanges = new[]
{
"string",
},
},
LinkedVpcNetwork = new Gcp.NetworkConnectivity.Inputs.SpokeLinkedVpcNetworkArgs
{
Uri = "string",
ExcludeExportRanges = new[]
{
"string",
},
IncludeExportRanges = new[]
{
"string",
},
},
LinkedVpnTunnels = new Gcp.NetworkConnectivity.Inputs.SpokeLinkedVpnTunnelsArgs
{
SiteToSiteDataTransfer = false,
Uris = new[]
{
"string",
},
IncludeImportRanges = new[]
{
"string",
},
},
Name = "string",
Project = "string",
});
example, err := networkconnectivity.NewSpoke(ctx, "spokeResource", &networkconnectivity.SpokeArgs{
Hub: pulumi.String("string"),
Location: pulumi.String("string"),
Description: pulumi.String("string"),
Labels: pulumi.StringMap{
"string": pulumi.String("string"),
},
LinkedInterconnectAttachments: &networkconnectivity.SpokeLinkedInterconnectAttachmentsArgs{
SiteToSiteDataTransfer: pulumi.Bool(false),
Uris: pulumi.StringArray{
pulumi.String("string"),
},
IncludeImportRanges: pulumi.StringArray{
pulumi.String("string"),
},
},
LinkedProducerVpcNetwork: &networkconnectivity.SpokeLinkedProducerVpcNetworkArgs{
Network: pulumi.String("string"),
Peering: pulumi.String("string"),
ExcludeExportRanges: pulumi.StringArray{
pulumi.String("string"),
},
IncludeExportRanges: pulumi.StringArray{
pulumi.String("string"),
},
ProducerNetwork: pulumi.String("string"),
},
LinkedRouterApplianceInstances: &networkconnectivity.SpokeLinkedRouterApplianceInstancesArgs{
Instances: networkconnectivity.SpokeLinkedRouterApplianceInstancesInstanceArray{
&networkconnectivity.SpokeLinkedRouterApplianceInstancesInstanceArgs{
IpAddress: pulumi.String("string"),
VirtualMachine: pulumi.String("string"),
},
},
SiteToSiteDataTransfer: pulumi.Bool(false),
IncludeImportRanges: pulumi.StringArray{
pulumi.String("string"),
},
},
LinkedVpcNetwork: &networkconnectivity.SpokeLinkedVpcNetworkArgs{
Uri: pulumi.String("string"),
ExcludeExportRanges: pulumi.StringArray{
pulumi.String("string"),
},
IncludeExportRanges: pulumi.StringArray{
pulumi.String("string"),
},
},
LinkedVpnTunnels: &networkconnectivity.SpokeLinkedVpnTunnelsArgs{
SiteToSiteDataTransfer: pulumi.Bool(false),
Uris: pulumi.StringArray{
pulumi.String("string"),
},
IncludeImportRanges: pulumi.StringArray{
pulumi.String("string"),
},
},
Name: pulumi.String("string"),
Project: pulumi.String("string"),
})
var spokeResource = new Spoke("spokeResource", SpokeArgs.builder()
.hub("string")
.location("string")
.description("string")
.labels(Map.of("string", "string"))
.linkedInterconnectAttachments(SpokeLinkedInterconnectAttachmentsArgs.builder()
.siteToSiteDataTransfer(false)
.uris("string")
.includeImportRanges("string")
.build())
.linkedProducerVpcNetwork(SpokeLinkedProducerVpcNetworkArgs.builder()
.network("string")
.peering("string")
.excludeExportRanges("string")
.includeExportRanges("string")
.producerNetwork("string")
.build())
.linkedRouterApplianceInstances(SpokeLinkedRouterApplianceInstancesArgs.builder()
.instances(SpokeLinkedRouterApplianceInstancesInstanceArgs.builder()
.ipAddress("string")
.virtualMachine("string")
.build())
.siteToSiteDataTransfer(false)
.includeImportRanges("string")
.build())
.linkedVpcNetwork(SpokeLinkedVpcNetworkArgs.builder()
.uri("string")
.excludeExportRanges("string")
.includeExportRanges("string")
.build())
.linkedVpnTunnels(SpokeLinkedVpnTunnelsArgs.builder()
.siteToSiteDataTransfer(false)
.uris("string")
.includeImportRanges("string")
.build())
.name("string")
.project("string")
.build());
spoke_resource = gcp.networkconnectivity.Spoke("spokeResource",
hub="string",
location="string",
description="string",
labels={
"string": "string",
},
linked_interconnect_attachments={
"site_to_site_data_transfer": False,
"uris": ["string"],
"include_import_ranges": ["string"],
},
linked_producer_vpc_network={
"network": "string",
"peering": "string",
"exclude_export_ranges": ["string"],
"include_export_ranges": ["string"],
"producer_network": "string",
},
linked_router_appliance_instances={
"instances": [{
"ip_address": "string",
"virtual_machine": "string",
}],
"site_to_site_data_transfer": False,
"include_import_ranges": ["string"],
},
linked_vpc_network={
"uri": "string",
"exclude_export_ranges": ["string"],
"include_export_ranges": ["string"],
},
linked_vpn_tunnels={
"site_to_site_data_transfer": False,
"uris": ["string"],
"include_import_ranges": ["string"],
},
name="string",
project="string")
const spokeResource = new gcp.networkconnectivity.Spoke("spokeResource", {
hub: "string",
location: "string",
description: "string",
labels: {
string: "string",
},
linkedInterconnectAttachments: {
siteToSiteDataTransfer: false,
uris: ["string"],
includeImportRanges: ["string"],
},
linkedProducerVpcNetwork: {
network: "string",
peering: "string",
excludeExportRanges: ["string"],
includeExportRanges: ["string"],
producerNetwork: "string",
},
linkedRouterApplianceInstances: {
instances: [{
ipAddress: "string",
virtualMachine: "string",
}],
siteToSiteDataTransfer: false,
includeImportRanges: ["string"],
},
linkedVpcNetwork: {
uri: "string",
excludeExportRanges: ["string"],
includeExportRanges: ["string"],
},
linkedVpnTunnels: {
siteToSiteDataTransfer: false,
uris: ["string"],
includeImportRanges: ["string"],
},
name: "string",
project: "string",
});
type: gcp:networkconnectivity:Spoke
properties:
description: string
hub: string
labels:
string: string
linkedInterconnectAttachments:
includeImportRanges:
- string
siteToSiteDataTransfer: false
uris:
- string
linkedProducerVpcNetwork:
excludeExportRanges:
- string
includeExportRanges:
- string
network: string
peering: string
producerNetwork: string
linkedRouterApplianceInstances:
includeImportRanges:
- string
instances:
- ipAddress: string
virtualMachine: string
siteToSiteDataTransfer: false
linkedVpcNetwork:
excludeExportRanges:
- string
includeExportRanges:
- string
uri: string
linkedVpnTunnels:
includeImportRanges:
- string
siteToSiteDataTransfer: false
uris:
- string
location: string
name: string
project: string
Spoke Resource Properties
To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.
Inputs
In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.
The Spoke resource accepts the following input properties:
- Hub string
- Immutable. The URI of the hub that this spoke is attached to.
- Location string
- The location for the resource
- Description string
- An optional description of the spoke.
- Labels Dictionary<string, string>
- Optional labels in key:value format. For more information about labels, see Requirements for labels.
Note: This field is non-authoritative, and will only manage the labels present in your configuration.
Please refer to the field
effective_labels
for all of the labels present on the resource. - Linked
Interconnect SpokeAttachments Linked Interconnect Attachments - 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. Structure is documented below.
- Linked
Producer SpokeVpc Network Linked Producer Vpc Network - Producer VPC network that is associated with the spoke. Structure is documented below.
- Linked
Router SpokeAppliance Instances Linked Router Appliance Instances - The URIs of linked Router appliance resources Structure is documented below.
- Linked
Vpc SpokeNetwork Linked Vpc Network - VPC network that is associated with the spoke. Structure is documented below.
- Linked
Vpn SpokeTunnels Linked Vpn Tunnels - The URIs of linked VPN tunnel resources Structure is documented below.
- Name string
- Immutable. The name of the spoke. Spoke names must be unique.
- Project string
- The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
- Hub string
- Immutable. The URI of the hub that this spoke is attached to.
- Location string
- The location for the resource
- Description string
- An optional description of the spoke.
- Labels map[string]string
- Optional labels in key:value format. For more information about labels, see Requirements for labels.
Note: This field is non-authoritative, and will only manage the labels present in your configuration.
Please refer to the field
effective_labels
for all of the labels present on the resource. - Linked
Interconnect SpokeAttachments Linked Interconnect Attachments Args - 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. Structure is documented below.
- Linked
Producer SpokeVpc Network Linked Producer Vpc Network Args - Producer VPC network that is associated with the spoke. Structure is documented below.
- Linked
Router SpokeAppliance Instances Linked Router Appliance Instances Args - The URIs of linked Router appliance resources Structure is documented below.
- Linked
Vpc SpokeNetwork Linked Vpc Network Args - VPC network that is associated with the spoke. Structure is documented below.
- Linked
Vpn SpokeTunnels Linked Vpn Tunnels Args - The URIs of linked VPN tunnel resources Structure is documented below.
- Name string
- Immutable. The name of the spoke. Spoke names must be unique.
- Project string
- The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
- hub String
- Immutable. The URI of the hub that this spoke is attached to.
- location String
- The location for the resource
- description String
- An optional description of the spoke.
- labels Map<String,String>
- Optional labels in key:value format. For more information about labels, see Requirements for labels.
Note: This field is non-authoritative, and will only manage the labels present in your configuration.
Please refer to the field
effective_labels
for all of the labels present on the resource. - linked
Interconnect SpokeAttachments Linked Interconnect Attachments - 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. Structure is documented below.
- linked
Producer SpokeVpc Network Linked Producer Vpc Network - Producer VPC network that is associated with the spoke. Structure is documented below.
- linked
Router SpokeAppliance Instances Linked Router Appliance Instances - The URIs of linked Router appliance resources Structure is documented below.
- linked
Vpc SpokeNetwork Linked Vpc Network - VPC network that is associated with the spoke. Structure is documented below.
- linked
Vpn SpokeTunnels Linked Vpn Tunnels - The URIs of linked VPN tunnel resources Structure is documented below.
- name String
- Immutable. The name of the spoke. Spoke names must be unique.
- project String
- The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
- hub string
- Immutable. The URI of the hub that this spoke is attached to.
- location string
- The location for the resource
- description string
- An optional description of the spoke.
- labels {[key: string]: string}
- Optional labels in key:value format. For more information about labels, see Requirements for labels.
Note: This field is non-authoritative, and will only manage the labels present in your configuration.
Please refer to the field
effective_labels
for all of the labels present on the resource. - linked
Interconnect SpokeAttachments Linked Interconnect Attachments - 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. Structure is documented below.
- linked
Producer SpokeVpc Network Linked Producer Vpc Network - Producer VPC network that is associated with the spoke. Structure is documented below.
- linked
Router SpokeAppliance Instances Linked Router Appliance Instances - The URIs of linked Router appliance resources Structure is documented below.
- linked
Vpc SpokeNetwork Linked Vpc Network - VPC network that is associated with the spoke. Structure is documented below.
- linked
Vpn SpokeTunnels Linked Vpn Tunnels - The URIs of linked VPN tunnel resources Structure is documented below.
- name string
- Immutable. The name of the spoke. Spoke names must be unique.
- project string
- The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
- hub str
- Immutable. The URI of the hub that this spoke is attached to.
- location str
- The location for the resource
- description str
- An optional description of the spoke.
- labels Mapping[str, str]
- Optional labels in key:value format. For more information about labels, see Requirements for labels.
Note: This field is non-authoritative, and will only manage the labels present in your configuration.
Please refer to the field
effective_labels
for all of the labels present on the resource. - linked_
interconnect_ Spokeattachments Linked Interconnect Attachments Args - 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. Structure is documented below.
- linked_
producer_ Spokevpc_ network Linked Producer Vpc Network Args - Producer VPC network that is associated with the spoke. Structure is documented below.
- linked_
router_ Spokeappliance_ instances Linked Router Appliance Instances Args - The URIs of linked Router appliance resources Structure is documented below.
- linked_
vpc_ Spokenetwork Linked Vpc Network Args - VPC network that is associated with the spoke. Structure is documented below.
- linked_
vpn_ Spoketunnels Linked Vpn Tunnels Args - The URIs of linked VPN tunnel resources Structure is documented below.
- name str
- Immutable. The name of the spoke. Spoke names must be unique.
- project str
- The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
- hub String
- Immutable. The URI of the hub that this spoke is attached to.
- location String
- The location for the resource
- description String
- An optional description of the spoke.
- labels Map<String>
- Optional labels in key:value format. For more information about labels, see Requirements for labels.
Note: This field is non-authoritative, and will only manage the labels present in your configuration.
Please refer to the field
effective_labels
for all of the labels present on the resource. - linked
Interconnect Property MapAttachments - 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. Structure is documented below.
- linked
Producer Property MapVpc Network - Producer VPC network that is associated with the spoke. Structure is documented below.
- linked
Router Property MapAppliance Instances - The URIs of linked Router appliance resources Structure is documented below.
- linked
Vpc Property MapNetwork - VPC network that is associated with the spoke. Structure is documented below.
- linked
Vpn Property MapTunnels - The URIs of linked VPN tunnel resources Structure is documented below.
- name String
- Immutable. The name of the spoke. Spoke names must be unique.
- project String
- The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
Outputs
All input properties are implicitly available as output properties. Additionally, the Spoke resource produces the following output properties:
- Create
Time string - Output only. The time the spoke was created.
- Effective
Labels Dictionary<string, string> - All of labels (key/value pairs) present on the resource in GCP, including the labels configured through Pulumi, other clients and services.
- Id string
- The provider-assigned unique ID for this managed resource.
- Pulumi
Labels Dictionary<string, string> - The combination of labels configured directly on the resource and default labels configured on the provider.
- State string
- Output only. The current lifecycle state of this spoke.
- Unique
Id string - 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.
- Update
Time string - Output only. The time the spoke was last updated.
- Create
Time string - Output only. The time the spoke was created.
- Effective
Labels map[string]string - All of labels (key/value pairs) present on the resource in GCP, including the labels configured through Pulumi, other clients and services.
- Id string
- The provider-assigned unique ID for this managed resource.
- Pulumi
Labels map[string]string - The combination of labels configured directly on the resource and default labels configured on the provider.
- State string
- Output only. The current lifecycle state of this spoke.
- Unique
Id string - 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.
- Update
Time string - Output only. The time the spoke was last updated.
- create
Time String - Output only. The time the spoke was created.
- effective
Labels Map<String,String> - All of labels (key/value pairs) present on the resource in GCP, including the labels configured through Pulumi, other clients and services.
- id String
- The provider-assigned unique ID for this managed resource.
- pulumi
Labels Map<String,String> - The combination of labels configured directly on the resource and default labels configured on the provider.
- state String
- Output only. The current lifecycle state of this spoke.
- unique
Id String - 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.
- update
Time String - Output only. The time the spoke was last updated.
- create
Time string - Output only. The time the spoke was created.
- effective
Labels {[key: string]: string} - All of labels (key/value pairs) present on the resource in GCP, including the labels configured through Pulumi, other clients and services.
- id string
- The provider-assigned unique ID for this managed resource.
- pulumi
Labels {[key: string]: string} - The combination of labels configured directly on the resource and default labels configured on the provider.
- state string
- Output only. The current lifecycle state of this spoke.
- unique
Id string - 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.
- update
Time string - Output only. The time the spoke was last updated.
- create_
time str - Output only. The time the spoke was created.
- effective_
labels Mapping[str, str] - All of labels (key/value pairs) present on the resource in GCP, including the labels configured through Pulumi, other clients and services.
- id str
- The provider-assigned unique ID for this managed resource.
- pulumi_
labels Mapping[str, str] - The combination of labels configured directly on the resource and default labels configured on the provider.
- state str
- Output only. The current lifecycle state of this spoke.
- unique_
id str - 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.
- update_
time str - Output only. The time the spoke was last updated.
- create
Time String - Output only. The time the spoke was created.
- effective
Labels Map<String> - All of labels (key/value pairs) present on the resource in GCP, including the labels configured through Pulumi, other clients and services.
- id String
- The provider-assigned unique ID for this managed resource.
- pulumi
Labels Map<String> - The combination of labels configured directly on the resource and default labels configured on the provider.
- state String
- Output only. The current lifecycle state of this spoke.
- unique
Id String - 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.
- update
Time String - Output only. The time the spoke was last updated.
Look up Existing Spoke Resource
Get an existing Spoke resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.
public static get(name: string, id: Input<ID>, state?: SpokeState, opts?: CustomResourceOptions): Spoke
@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
create_time: Optional[str] = None,
description: Optional[str] = None,
effective_labels: Optional[Mapping[str, str]] = None,
hub: Optional[str] = None,
labels: Optional[Mapping[str, str]] = None,
linked_interconnect_attachments: Optional[SpokeLinkedInterconnectAttachmentsArgs] = None,
linked_producer_vpc_network: Optional[SpokeLinkedProducerVpcNetworkArgs] = None,
linked_router_appliance_instances: Optional[SpokeLinkedRouterApplianceInstancesArgs] = None,
linked_vpc_network: Optional[SpokeLinkedVpcNetworkArgs] = None,
linked_vpn_tunnels: Optional[SpokeLinkedVpnTunnelsArgs] = None,
location: Optional[str] = None,
name: Optional[str] = None,
project: Optional[str] = None,
pulumi_labels: Optional[Mapping[str, str]] = None,
state: Optional[str] = None,
unique_id: Optional[str] = None,
update_time: Optional[str] = None) -> Spoke
func GetSpoke(ctx *Context, name string, id IDInput, state *SpokeState, opts ...ResourceOption) (*Spoke, error)
public static Spoke Get(string name, Input<string> id, SpokeState? state, CustomResourceOptions? opts = null)
public static Spoke get(String name, Output<String> id, SpokeState state, CustomResourceOptions options)
Resource lookup is not supported in YAML
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- resource_name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- Create
Time string - Output only. The time the spoke was created.
- Description string
- An optional description of the spoke.
- Effective
Labels Dictionary<string, string> - All of labels (key/value pairs) present on the resource in GCP, including the labels configured through Pulumi, other clients and services.
- Hub string
- Immutable. The URI of the hub that this spoke is attached to.
- Labels Dictionary<string, string>
- Optional labels in key:value format. For more information about labels, see Requirements for labels.
Note: This field is non-authoritative, and will only manage the labels present in your configuration.
Please refer to the field
effective_labels
for all of the labels present on the resource. - Linked
Interconnect SpokeAttachments Linked Interconnect Attachments - 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. Structure is documented below.
- Linked
Producer SpokeVpc Network Linked Producer Vpc Network - Producer VPC network that is associated with the spoke. Structure is documented below.
- Linked
Router SpokeAppliance Instances Linked Router Appliance Instances - The URIs of linked Router appliance resources Structure is documented below.
- Linked
Vpc SpokeNetwork Linked Vpc Network - VPC network that is associated with the spoke. Structure is documented below.
- Linked
Vpn SpokeTunnels Linked Vpn Tunnels - The URIs of linked VPN tunnel resources Structure is documented below.
- Location string
- The location for the resource
- Name string
- Immutable. The name of the spoke. Spoke names must be unique.
- Project string
- The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
- Pulumi
Labels Dictionary<string, string> - The combination of labels configured directly on the resource and default labels configured on the provider.
- State string
- Output only. The current lifecycle state of this spoke.
- Unique
Id string - 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.
- Update
Time string - Output only. The time the spoke was last updated.
- Create
Time string - Output only. The time the spoke was created.
- Description string
- An optional description of the spoke.
- Effective
Labels map[string]string - All of labels (key/value pairs) present on the resource in GCP, including the labels configured through Pulumi, other clients and services.
- Hub string
- Immutable. The URI of the hub that this spoke is attached to.
- Labels map[string]string
- Optional labels in key:value format. For more information about labels, see Requirements for labels.
Note: This field is non-authoritative, and will only manage the labels present in your configuration.
Please refer to the field
effective_labels
for all of the labels present on the resource. - Linked
Interconnect SpokeAttachments Linked Interconnect Attachments Args - 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. Structure is documented below.
- Linked
Producer SpokeVpc Network Linked Producer Vpc Network Args - Producer VPC network that is associated with the spoke. Structure is documented below.
- Linked
Router SpokeAppliance Instances Linked Router Appliance Instances Args - The URIs of linked Router appliance resources Structure is documented below.
- Linked
Vpc SpokeNetwork Linked Vpc Network Args - VPC network that is associated with the spoke. Structure is documented below.
- Linked
Vpn SpokeTunnels Linked Vpn Tunnels Args - The URIs of linked VPN tunnel resources Structure is documented below.
- Location string
- The location for the resource
- Name string
- Immutable. The name of the spoke. Spoke names must be unique.
- Project string
- The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
- Pulumi
Labels map[string]string - The combination of labels configured directly on the resource and default labels configured on the provider.
- State string
- Output only. The current lifecycle state of this spoke.
- Unique
Id string - 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.
- Update
Time string - Output only. The time the spoke was last updated.
- create
Time String - Output only. The time the spoke was created.
- description String
- An optional description of the spoke.
- effective
Labels Map<String,String> - All of labels (key/value pairs) present on the resource in GCP, including the labels configured through Pulumi, other clients and services.
- hub String
- Immutable. The URI of the hub that this spoke is attached to.
- labels Map<String,String>
- Optional labels in key:value format. For more information about labels, see Requirements for labels.
Note: This field is non-authoritative, and will only manage the labels present in your configuration.
Please refer to the field
effective_labels
for all of the labels present on the resource. - linked
Interconnect SpokeAttachments Linked Interconnect Attachments - 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. Structure is documented below.
- linked
Producer SpokeVpc Network Linked Producer Vpc Network - Producer VPC network that is associated with the spoke. Structure is documented below.
- linked
Router SpokeAppliance Instances Linked Router Appliance Instances - The URIs of linked Router appliance resources Structure is documented below.
- linked
Vpc SpokeNetwork Linked Vpc Network - VPC network that is associated with the spoke. Structure is documented below.
- linked
Vpn SpokeTunnels Linked Vpn Tunnels - The URIs of linked VPN tunnel resources Structure is documented below.
- location String
- The location for the resource
- name String
- Immutable. The name of the spoke. Spoke names must be unique.
- project String
- The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
- pulumi
Labels Map<String,String> - The combination of labels configured directly on the resource and default labels configured on the provider.
- state String
- Output only. The current lifecycle state of this spoke.
- unique
Id String - 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.
- update
Time String - Output only. The time the spoke was last updated.
- create
Time string - Output only. The time the spoke was created.
- description string
- An optional description of the spoke.
- effective
Labels {[key: string]: string} - All of labels (key/value pairs) present on the resource in GCP, including the labels configured through Pulumi, other clients and services.
- hub string
- Immutable. The URI of the hub that this spoke is attached to.
- labels {[key: string]: string}
- Optional labels in key:value format. For more information about labels, see Requirements for labels.
Note: This field is non-authoritative, and will only manage the labels present in your configuration.
Please refer to the field
effective_labels
for all of the labels present on the resource. - linked
Interconnect SpokeAttachments Linked Interconnect Attachments - 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. Structure is documented below.
- linked
Producer SpokeVpc Network Linked Producer Vpc Network - Producer VPC network that is associated with the spoke. Structure is documented below.
- linked
Router SpokeAppliance Instances Linked Router Appliance Instances - The URIs of linked Router appliance resources Structure is documented below.
- linked
Vpc SpokeNetwork Linked Vpc Network - VPC network that is associated with the spoke. Structure is documented below.
- linked
Vpn SpokeTunnels Linked Vpn Tunnels - The URIs of linked VPN tunnel resources Structure is documented below.
- location string
- The location for the resource
- name string
- Immutable. The name of the spoke. Spoke names must be unique.
- project string
- The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
- pulumi
Labels {[key: string]: string} - The combination of labels configured directly on the resource and default labels configured on the provider.
- state string
- Output only. The current lifecycle state of this spoke.
- unique
Id string - 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.
- update
Time string - Output only. The time the spoke was last updated.
- create_
time str - Output only. The time the spoke was created.
- description str
- An optional description of the spoke.
- effective_
labels Mapping[str, str] - All of labels (key/value pairs) present on the resource in GCP, including the labels configured through Pulumi, other clients and services.
- hub str
- Immutable. The URI of the hub that this spoke is attached to.
- labels Mapping[str, str]
- Optional labels in key:value format. For more information about labels, see Requirements for labels.
Note: This field is non-authoritative, and will only manage the labels present in your configuration.
Please refer to the field
effective_labels
for all of the labels present on the resource. - linked_
interconnect_ Spokeattachments Linked Interconnect Attachments Args - 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. Structure is documented below.
- linked_
producer_ Spokevpc_ network Linked Producer Vpc Network Args - Producer VPC network that is associated with the spoke. Structure is documented below.
- linked_
router_ Spokeappliance_ instances Linked Router Appliance Instances Args - The URIs of linked Router appliance resources Structure is documented below.
- linked_
vpc_ Spokenetwork Linked Vpc Network Args - VPC network that is associated with the spoke. Structure is documented below.
- linked_
vpn_ Spoketunnels Linked Vpn Tunnels Args - The URIs of linked VPN tunnel resources Structure is documented below.
- location str
- The location for the resource
- name str
- Immutable. The name of the spoke. Spoke names must be unique.
- project str
- The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
- pulumi_
labels Mapping[str, str] - The combination of labels configured directly on the resource and default labels configured on the provider.
- state str
- Output only. The current lifecycle state of this spoke.
- unique_
id str - 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.
- update_
time str - Output only. The time the spoke was last updated.
- create
Time String - Output only. The time the spoke was created.
- description String
- An optional description of the spoke.
- effective
Labels Map<String> - All of labels (key/value pairs) present on the resource in GCP, including the labels configured through Pulumi, other clients and services.
- hub String
- Immutable. The URI of the hub that this spoke is attached to.
- labels Map<String>
- Optional labels in key:value format. For more information about labels, see Requirements for labels.
Note: This field is non-authoritative, and will only manage the labels present in your configuration.
Please refer to the field
effective_labels
for all of the labels present on the resource. - linked
Interconnect Property MapAttachments - 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. Structure is documented below.
- linked
Producer Property MapVpc Network - Producer VPC network that is associated with the spoke. Structure is documented below.
- linked
Router Property MapAppliance Instances - The URIs of linked Router appliance resources Structure is documented below.
- linked
Vpc Property MapNetwork - VPC network that is associated with the spoke. Structure is documented below.
- linked
Vpn Property MapTunnels - The URIs of linked VPN tunnel resources Structure is documented below.
- location String
- The location for the resource
- name String
- Immutable. The name of the spoke. Spoke names must be unique.
- project String
- The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
- pulumi
Labels Map<String> - The combination of labels configured directly on the resource and default labels configured on the provider.
- state String
- Output only. The current lifecycle state of this spoke.
- unique
Id String - 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.
- update
Time String - Output only. The time the spoke was last updated.
Supporting Types
SpokeLinkedInterconnectAttachments, SpokeLinkedInterconnectAttachmentsArgs
- Site
To boolSite Data Transfer - 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 List<string>
- The URIs of linked interconnect attachment resources
- Include
Import List<string>Ranges - IP ranges allowed to be included during import from hub (does not control transit connectivity). The only allowed value for now is "ALL_IPV4_RANGES".
- Site
To boolSite Data Transfer - 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 []string
- The URIs of linked interconnect attachment resources
- Include
Import []stringRanges - IP ranges allowed to be included during import from hub (does not control transit connectivity). The only allowed value for now is "ALL_IPV4_RANGES".
- site
To BooleanSite Data Transfer - 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 List<String>
- The URIs of linked interconnect attachment resources
- include
Import List<String>Ranges - IP ranges allowed to be included during import from hub (does not control transit connectivity). The only allowed value for now is "ALL_IPV4_RANGES".
- site
To booleanSite Data Transfer - 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 string[]
- The URIs of linked interconnect attachment resources
- include
Import string[]Ranges - IP ranges allowed to be included during import from hub (does not control transit connectivity). The only allowed value for now is "ALL_IPV4_RANGES".
- site_
to_ boolsite_ data_ transfer - 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 Sequence[str]
- The URIs of linked interconnect attachment resources
- include_
import_ Sequence[str]ranges - IP ranges allowed to be included during import from hub (does not control transit connectivity). The only allowed value for now is "ALL_IPV4_RANGES".
- site
To BooleanSite Data Transfer - 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 List<String>
- The URIs of linked interconnect attachment resources
- include
Import List<String>Ranges - IP ranges allowed to be included during import from hub (does not control transit connectivity). The only allowed value for now is "ALL_IPV4_RANGES".
SpokeLinkedProducerVpcNetwork, SpokeLinkedProducerVpcNetworkArgs
- Network string
- The URI of the Service Consumer VPC that the Producer VPC is peered with.
- Peering string
- The name of the VPC peering between the Service Consumer VPC and the Producer VPC (defined in the Tenant project) which is added to the NCC hub. This peering must be in ACTIVE state.
- Exclude
Export List<string>Ranges - IP ranges encompassing the subnets to be excluded from peering.
- Include
Export List<string>Ranges - IP ranges allowed to be included from peering.
- Producer
Network string - (Output) The URI of the Producer VPC.
- Network string
- The URI of the Service Consumer VPC that the Producer VPC is peered with.
- Peering string
- The name of the VPC peering between the Service Consumer VPC and the Producer VPC (defined in the Tenant project) which is added to the NCC hub. This peering must be in ACTIVE state.
- Exclude
Export []stringRanges - IP ranges encompassing the subnets to be excluded from peering.
- Include
Export []stringRanges - IP ranges allowed to be included from peering.
- Producer
Network string - (Output) The URI of the Producer VPC.
- network String
- The URI of the Service Consumer VPC that the Producer VPC is peered with.
- peering String
- The name of the VPC peering between the Service Consumer VPC and the Producer VPC (defined in the Tenant project) which is added to the NCC hub. This peering must be in ACTIVE state.
- exclude
Export List<String>Ranges - IP ranges encompassing the subnets to be excluded from peering.
- include
Export List<String>Ranges - IP ranges allowed to be included from peering.
- producer
Network String - (Output) The URI of the Producer VPC.
- network string
- The URI of the Service Consumer VPC that the Producer VPC is peered with.
- peering string
- The name of the VPC peering between the Service Consumer VPC and the Producer VPC (defined in the Tenant project) which is added to the NCC hub. This peering must be in ACTIVE state.
- exclude
Export string[]Ranges - IP ranges encompassing the subnets to be excluded from peering.
- include
Export string[]Ranges - IP ranges allowed to be included from peering.
- producer
Network string - (Output) The URI of the Producer VPC.
- network str
- The URI of the Service Consumer VPC that the Producer VPC is peered with.
- peering str
- The name of the VPC peering between the Service Consumer VPC and the Producer VPC (defined in the Tenant project) which is added to the NCC hub. This peering must be in ACTIVE state.
- exclude_
export_ Sequence[str]ranges - IP ranges encompassing the subnets to be excluded from peering.
- include_
export_ Sequence[str]ranges - IP ranges allowed to be included from peering.
- producer_
network str - (Output) The URI of the Producer VPC.
- network String
- The URI of the Service Consumer VPC that the Producer VPC is peered with.
- peering String
- The name of the VPC peering between the Service Consumer VPC and the Producer VPC (defined in the Tenant project) which is added to the NCC hub. This peering must be in ACTIVE state.
- exclude
Export List<String>Ranges - IP ranges encompassing the subnets to be excluded from peering.
- include
Export List<String>Ranges - IP ranges allowed to be included from peering.
- producer
Network String - (Output) The URI of the Producer VPC.
SpokeLinkedRouterApplianceInstances, SpokeLinkedRouterApplianceInstancesArgs
- Instances
List<Spoke
Linked Router Appliance Instances Instance> - The list of router appliance instances Structure is documented below.
- Site
To boolSite Data Transfer - 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.
- Include
Import List<string>Ranges - IP ranges allowed to be included during import from hub (does not control transit connectivity). The only allowed value for now is "ALL_IPV4_RANGES".
- Instances
[]Spoke
Linked Router Appliance Instances Instance - The list of router appliance instances Structure is documented below.
- Site
To boolSite Data Transfer - 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.
- Include
Import []stringRanges - IP ranges allowed to be included during import from hub (does not control transit connectivity). The only allowed value for now is "ALL_IPV4_RANGES".
- instances
List<Spoke
Linked Router Appliance Instances Instance> - The list of router appliance instances Structure is documented below.
- site
To BooleanSite Data Transfer - 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.
- include
Import List<String>Ranges - IP ranges allowed to be included during import from hub (does not control transit connectivity). The only allowed value for now is "ALL_IPV4_RANGES".
- instances
Spoke
Linked Router Appliance Instances Instance[] - The list of router appliance instances Structure is documented below.
- site
To booleanSite Data Transfer - 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.
- include
Import string[]Ranges - IP ranges allowed to be included during import from hub (does not control transit connectivity). The only allowed value for now is "ALL_IPV4_RANGES".
- instances
Sequence[Spoke
Linked Router Appliance Instances Instance] - The list of router appliance instances Structure is documented below.
- site_
to_ boolsite_ data_ transfer - 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.
- include_
import_ Sequence[str]ranges - IP ranges allowed to be included during import from hub (does not control transit connectivity). The only allowed value for now is "ALL_IPV4_RANGES".
- instances List<Property Map>
- The list of router appliance instances Structure is documented below.
- site
To BooleanSite Data Transfer - 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.
- include
Import List<String>Ranges - IP ranges allowed to be included during import from hub (does not control transit connectivity). The only allowed value for now is "ALL_IPV4_RANGES".
SpokeLinkedRouterApplianceInstancesInstance, SpokeLinkedRouterApplianceInstancesInstanceArgs
- Ip
Address string - The IP address on the VM to use for peering.
- Virtual
Machine string - The URI of the virtual machine resource
- Ip
Address string - The IP address on the VM to use for peering.
- Virtual
Machine string - The URI of the virtual machine resource
- ip
Address String - The IP address on the VM to use for peering.
- virtual
Machine String - The URI of the virtual machine resource
- ip
Address string - The IP address on the VM to use for peering.
- virtual
Machine string - The URI of the virtual machine resource
- ip_
address str - The IP address on the VM to use for peering.
- virtual_
machine str - The URI of the virtual machine resource
- ip
Address String - The IP address on the VM to use for peering.
- virtual
Machine String - The URI of the virtual machine resource
SpokeLinkedVpcNetwork, SpokeLinkedVpcNetworkArgs
- Uri string
- The URI of the VPC network resource.
- Exclude
Export List<string>Ranges - IP ranges encompassing the subnets to be excluded from peering.
- Include
Export List<string>Ranges - IP ranges allowed to be included from peering.
- Uri string
- The URI of the VPC network resource.
- Exclude
Export []stringRanges - IP ranges encompassing the subnets to be excluded from peering.
- Include
Export []stringRanges - IP ranges allowed to be included from peering.
- uri String
- The URI of the VPC network resource.
- exclude
Export List<String>Ranges - IP ranges encompassing the subnets to be excluded from peering.
- include
Export List<String>Ranges - IP ranges allowed to be included from peering.
- uri string
- The URI of the VPC network resource.
- exclude
Export string[]Ranges - IP ranges encompassing the subnets to be excluded from peering.
- include
Export string[]Ranges - IP ranges allowed to be included from peering.
- uri str
- The URI of the VPC network resource.
- exclude_
export_ Sequence[str]ranges - IP ranges encompassing the subnets to be excluded from peering.
- include_
export_ Sequence[str]ranges - IP ranges allowed to be included from peering.
- uri String
- The URI of the VPC network resource.
- exclude
Export List<String>Ranges - IP ranges encompassing the subnets to be excluded from peering.
- include
Export List<String>Ranges - IP ranges allowed to be included from peering.
SpokeLinkedVpnTunnels, SpokeLinkedVpnTunnelsArgs
- Site
To boolSite Data Transfer - 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 List<string>
- The URIs of linked VPN tunnel resources.
- Include
Import List<string>Ranges - IP ranges allowed to be included during import from hub (does not control transit connectivity). The only allowed value for now is "ALL_IPV4_RANGES".
- Site
To boolSite Data Transfer - 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 []string
- The URIs of linked VPN tunnel resources.
- Include
Import []stringRanges - IP ranges allowed to be included during import from hub (does not control transit connectivity). The only allowed value for now is "ALL_IPV4_RANGES".
- site
To BooleanSite Data Transfer - 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 List<String>
- The URIs of linked VPN tunnel resources.
- include
Import List<String>Ranges - IP ranges allowed to be included during import from hub (does not control transit connectivity). The only allowed value for now is "ALL_IPV4_RANGES".
- site
To booleanSite Data Transfer - 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 string[]
- The URIs of linked VPN tunnel resources.
- include
Import string[]Ranges - IP ranges allowed to be included during import from hub (does not control transit connectivity). The only allowed value for now is "ALL_IPV4_RANGES".
- site_
to_ boolsite_ data_ transfer - 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 Sequence[str]
- The URIs of linked VPN tunnel resources.
- include_
import_ Sequence[str]ranges - IP ranges allowed to be included during import from hub (does not control transit connectivity). The only allowed value for now is "ALL_IPV4_RANGES".
- site
To BooleanSite Data Transfer - 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 List<String>
- The URIs of linked VPN tunnel resources.
- include
Import List<String>Ranges - IP ranges allowed to be included during import from hub (does not control transit connectivity). The only allowed value for now is "ALL_IPV4_RANGES".
Import
Spoke can be imported using any of these accepted formats:
projects/{{project}}/locations/{{location}}/spokes/{{name}}
{{project}}/{{location}}/{{name}}
{{location}}/{{name}}
When using the pulumi import
command, Spoke can be imported using one of the formats above. For example:
$ pulumi import gcp:networkconnectivity/spoke:Spoke default projects/{{project}}/locations/{{location}}/spokes/{{name}}
$ pulumi import gcp:networkconnectivity/spoke:Spoke default {{project}}/{{location}}/{{name}}
$ pulumi import gcp:networkconnectivity/spoke:Spoke default {{location}}/{{name}}
To learn more about importing existing cloud resources, see Importing resources.
Package Details
- Repository
- Google Cloud (GCP) Classic pulumi/pulumi-gcp
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
google-beta
Terraform Provider.