Spoke

class Spoke : KotlinCustomResource

The NetworkConnectivity Spoke resource

Example Usage

Linked_vpc_network

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()
.autoCreateSubnetworks(false)
.build());
var basicHub = new Hub("basicHub", HubArgs.builder()
.description("A sample hub")
.labels(Map.of("label-two", "value-one"))
.build());
var primary = new Spoke("primary", SpokeArgs.builder()
.location("global")
.description("A sample spoke with a linked routher 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")
.uri(network.selfLink())
.build())
.build());
}
}

Router_appliance

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()
.autoCreateSubnetworks(false)
.build());
var subnetwork = new Subnetwork("subnetwork", SubnetworkArgs.builder()
.ipCidrRange("10.0.0.0/28")
.region("us-west1")
.network(network.selfLink())
.build());
var instance = new Instance("instance", InstanceArgs.builder()
.machineType("e2-medium")
.canIpForward(true)
.zone("us-west1-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()
.description("A sample hub")
.labels(Map.of("label-two", "value-one"))
.build());
var primary = new Spoke("primary", SpokeArgs.builder()
.location("us-west1")
.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)
.build())
.build());
}
}

Import

Spoke can be imported using any of these accepted formats* projects/{{project}}/locations/{{location}}/spokes/{{name}} * {{project}}/{{location}}/{{name}} * {{location}}/{{name}} In Terraform v1.5.0 and later, use an import block to import Spoke using one of the formats above. For exampletf import { id = "projects/{{project}}/locations/{{location}}/spokes/{{name}}" to = google_network_connectivity_spoke.default }

$ pulumi import gcp:networkconnectivity/spoke:Spoke When using the [`terraform import` command](https://developer.hashicorp.com/terraform/cli/commands/import), 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}}

Properties

Link copied to clipboard
val createTime: Output<String>

Output only. The time the spoke was created.

Link copied to clipboard
val description: Output<String>?

An optional description of the spoke.

Link copied to clipboard
val effectiveLabels: Output<Map<String, Any>>

All of labels (key/value pairs) present on the resource in GCP, including the labels configured through Pulumi, other clients and services.

Link copied to clipboard
val hub: Output<String>

Immutable. The URI of the hub that this spoke is attached to.

Link copied to clipboard
val id: Output<String>
Link copied to clipboard
val labels: Output<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.

Link copied to clipboard

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.

Link copied to clipboard

The URIs of linked Router appliance resources

Link copied to clipboard

VPC network that is associated with the spoke.

Link copied to clipboard

The URIs of linked VPN tunnel resources

Link copied to clipboard
val location: Output<String>

The location for the resource

Link copied to clipboard
val name: Output<String>

Immutable. The name of the spoke. Spoke names must be unique.

Link copied to clipboard
val project: Output<String>

The project for the resource

Link copied to clipboard
val pulumiChildResources: Set<KotlinResource>
Link copied to clipboard
val pulumiLabels: Output<Map<String, Any>>

The combination of labels configured directly on the resource and default labels configured on the provider.

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
val state: Output<String>

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

Link copied to clipboard
val uniqueId: Output<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.

Link copied to clipboard
val updateTime: Output<String>

Output only. The time the spoke was last updated.

Link copied to clipboard
val urn: Output<String>