All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.pulumi.gcp.networkconnectivity.kotlin.Spoke.kt Maven / Gradle / Ivy

Go to download

Build cloud applications and infrastructure by combining the safety and reliability of infrastructure as code with the power of the Kotlin programming language.

There is a newer version: 8.10.0.0
Show newest version
@file:Suppress("NAME_SHADOWING", "DEPRECATION")

package com.pulumi.gcp.networkconnectivity.kotlin

import com.pulumi.core.Output
import com.pulumi.gcp.networkconnectivity.kotlin.outputs.SpokeLinkedInterconnectAttachments
import com.pulumi.gcp.networkconnectivity.kotlin.outputs.SpokeLinkedRouterApplianceInstances
import com.pulumi.gcp.networkconnectivity.kotlin.outputs.SpokeLinkedVpcNetwork
import com.pulumi.gcp.networkconnectivity.kotlin.outputs.SpokeLinkedVpnTunnels
import com.pulumi.kotlin.KotlinCustomResource
import com.pulumi.kotlin.PulumiTagMarker
import com.pulumi.kotlin.ResourceMapper
import com.pulumi.kotlin.options.CustomResourceOptions
import com.pulumi.kotlin.options.CustomResourceOptionsBuilder
import com.pulumi.resources.Resource
import kotlin.Any
import kotlin.Boolean
import kotlin.String
import kotlin.Suppress
import kotlin.Unit
import kotlin.collections.Map
import com.pulumi.gcp.networkconnectivity.kotlin.outputs.SpokeLinkedInterconnectAttachments.Companion.toKotlin as spokeLinkedInterconnectAttachmentsToKotlin
import com.pulumi.gcp.networkconnectivity.kotlin.outputs.SpokeLinkedRouterApplianceInstances.Companion.toKotlin as spokeLinkedRouterApplianceInstancesToKotlin
import com.pulumi.gcp.networkconnectivity.kotlin.outputs.SpokeLinkedVpcNetwork.Companion.toKotlin as spokeLinkedVpcNetworkToKotlin
import com.pulumi.gcp.networkconnectivity.kotlin.outputs.SpokeLinkedVpnTunnels.Companion.toKotlin as spokeLinkedVpnTunnelsToKotlin

/**
 * Builder for [Spoke].
 */
@PulumiTagMarker
public class SpokeResourceBuilder internal constructor() {
    public var name: String? = null

    public var args: SpokeArgs = SpokeArgs()

    public var opts: CustomResourceOptions = CustomResourceOptions()

    /**
     * @param name The _unique_ name of the resulting resource.
     */
    public fun name(`value`: String) {
        this.name = value
    }

    /**
     * @param block The arguments to use to populate this resource's properties.
     */
    public suspend fun args(block: suspend SpokeArgsBuilder.() -> Unit) {
        val builder = SpokeArgsBuilder()
        block(builder)
        this.args = builder.build()
    }

    /**
     * @param block A bag of options that control this resource's behavior.
     */
    public suspend fun opts(block: suspend CustomResourceOptionsBuilder.() -> Unit) {
        this.opts = com.pulumi.kotlin.options.CustomResourceOptions.opts(block)
    }

    internal fun build(): Spoke {
        val builtJavaResource = com.pulumi.gcp.networkconnectivity.Spoke(
            this.name,
            this.args.toJava(),
            this.opts.toJava(),
        )
        return Spoke(builtJavaResource)
    }
}

/**
 * The NetworkConnectivity Spoke resource
 * ## Example Usage
 * ### Linked_vpc_network
 * 
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as gcp from "@pulumi/gcp";
 * const network = new gcp.compute.Network("network", {
 *     name: "network",
 *     autoCreateSubnetworks: false,
 * });
 * const basicHub = new gcp.networkconnectivity.Hub("basic_hub", {
 *     name: "hub",
 *     description: "A sample hub",
 *     labels: {
 *         "label-two": "value-one",
 *     },
 * });
 * const primary = new gcp.networkconnectivity.Spoke("primary", {
 *     name: "name",
 *     location: "global",
 *     description: "A sample spoke with a linked routher appliance instance",
 *     labels: {
 *         "label-one": "value-one",
 *     },
 *     hub: basicHub.id,
 *     linkedVpcNetwork: {
 *         excludeExportRanges: [
 *             "198.51.100.0/24",
 *             "10.10.0.0/16",
 *         ],
 *         uri: network.selfLink,
 *     },
 * });
 * ```
 * ```python
 * import pulumi
 * import pulumi_gcp as gcp
 * network = gcp.compute.Network("network",
 *     name="network",
 *     auto_create_subnetworks=False)
 * basic_hub = gcp.networkconnectivity.Hub("basic_hub",
 *     name="hub",
 *     description="A sample hub",
 *     labels={
 *         "label-two": "value-one",
 *     })
 * primary = gcp.networkconnectivity.Spoke("primary",
 *     name="name",
 *     location="global",
 *     description="A sample spoke with a linked routher appliance instance",
 *     labels={
 *         "label-one": "value-one",
 *     },
 *     hub=basic_hub.id,
 *     linked_vpc_network=gcp.networkconnectivity.SpokeLinkedVpcNetworkArgs(
 *         exclude_export_ranges=[
 *             "198.51.100.0/24",
 *             "10.10.0.0/16",
 *         ],
 *         uri=network.self_link,
 *     ))
 * ```
 * ```csharp
 * 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 = "network",
 *         AutoCreateSubnetworks = false,
 *     });
 *     var basicHub = new Gcp.NetworkConnectivity.Hub("basic_hub", new()
 *     {
 *         Name = "hub",
 *         Description = "A sample hub",
 *         Labels =
 *         {
 *             { "label-two", "value-one" },
 *         },
 *     });
 *     var primary = new Gcp.NetworkConnectivity.Spoke("primary", new()
 *     {
 *         Name = "name",
 *         Location = "global",
 *         Description = "A sample spoke with a linked routher 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",
 *             },
 *             Uri = network.SelfLink,
 *         },
 *     });
 * });
 * ```
 * ```go
 * package main
 * import (
 * 	"github.com/pulumi/pulumi-gcp/sdk/v7/go/gcp/compute"
 * 	"github.com/pulumi/pulumi-gcp/sdk/v7/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("network"),
 * 			AutoCreateSubnetworks: pulumi.Bool(false),
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		basicHub, err := networkconnectivity.NewHub(ctx, "basic_hub", &networkconnectivity.HubArgs{
 * 			Name:        pulumi.String("hub"),
 * 			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("name"),
 * 			Location:    pulumi.String("global"),
 * 			Description: pulumi.String("A sample spoke with a linked routher 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"),
 * 				},
 * 				Uri: network.SelfLink,
 * 			},
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		return nil
 * 	})
 * }
 * ```
 * ```java
 * 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("network")
 *             .autoCreateSubnetworks(false)
 *             .build());
 *         var basicHub = new Hub("basicHub", HubArgs.builder()
 *             .name("hub")
 *             .description("A sample hub")
 *             .labels(Map.of("label-two", "value-one"))
 *             .build());
 *         var primary = new Spoke("primary", SpokeArgs.builder()
 *             .name("name")
 *             .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());
 *     }
 * }
 * ```
 * ```yaml
 * resources:
 *   network:
 *     type: gcp:compute:Network
 *     properties:
 *       name: network
 *       autoCreateSubnetworks: false
 *   basicHub:
 *     type: gcp:networkconnectivity:Hub
 *     name: basic_hub
 *     properties:
 *       name: hub
 *       description: A sample hub
 *       labels:
 *         label-two: value-one
 *   primary:
 *     type: gcp:networkconnectivity:Spoke
 *     properties:
 *       name: name
 *       location: global
 *       description: A sample spoke with a linked routher appliance instance
 *       labels:
 *         label-one: value-one
 *       hub: ${basicHub.id}
 *       linkedVpcNetwork:
 *         excludeExportRanges:
 *           - 198.51.100.0/24
 *           - 10.10.0.0/16
 *         uri: ${network.selfLink}
 * ```
 * 
 * ### Router_appliance
 * 
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as gcp from "@pulumi/gcp";
 * const network = new gcp.compute.Network("network", {
 *     name: "network",
 *     autoCreateSubnetworks: false,
 * });
 * const subnetwork = new gcp.compute.Subnetwork("subnetwork", {
 *     name: "subnet",
 *     ipCidrRange: "10.0.0.0/28",
 *     region: "us-west1",
 *     network: network.selfLink,
 * });
 * const instance = new gcp.compute.Instance("instance", {
 *     name: "instance",
 *     machineType: "e2-medium",
 *     canIpForward: true,
 *     zone: "us-west1-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: "hub",
 *     description: "A sample hub",
 *     labels: {
 *         "label-two": "value-one",
 *     },
 * });
 * const primary = new gcp.networkconnectivity.Spoke("primary", {
 *     name: "name",
 *     location: "us-west1",
 *     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,
 *     },
 * });
 * ```
 * ```python
 * import pulumi
 * import pulumi_gcp as gcp
 * network = gcp.compute.Network("network",
 *     name="network",
 *     auto_create_subnetworks=False)
 * subnetwork = gcp.compute.Subnetwork("subnetwork",
 *     name="subnet",
 *     ip_cidr_range="10.0.0.0/28",
 *     region="us-west1",
 *     network=network.self_link)
 * instance = gcp.compute.Instance("instance",
 *     name="instance",
 *     machine_type="e2-medium",
 *     can_ip_forward=True,
 *     zone="us-west1-a",
 *     boot_disk=gcp.compute.InstanceBootDiskArgs(
 *         initialize_params=gcp.compute.InstanceBootDiskInitializeParamsArgs(
 *             image="projects/debian-cloud/global/images/debian-10-buster-v20210817",
 *         ),
 *     ),
 *     network_interfaces=[gcp.compute.InstanceNetworkInterfaceArgs(
 *         subnetwork=subnetwork.name,
 *         network_ip="10.0.0.2",
 *         access_configs=[gcp.compute.InstanceNetworkInterfaceAccessConfigArgs(
 *             network_tier="PREMIUM",
 *         )],
 *     )])
 * basic_hub = gcp.networkconnectivity.Hub("basic_hub",
 *     name="hub",
 *     description="A sample hub",
 *     labels={
 *         "label-two": "value-one",
 *     })
 * primary = gcp.networkconnectivity.Spoke("primary",
 *     name="name",
 *     location="us-west1",
 *     description="A sample spoke with a linked routher appliance instance",
 *     labels={
 *         "label-one": "value-one",
 *     },
 *     hub=basic_hub.id,
 *     linked_router_appliance_instances=gcp.networkconnectivity.SpokeLinkedRouterApplianceInstancesArgs(
 *         instances=[gcp.networkconnectivity.SpokeLinkedRouterApplianceInstancesInstanceArgs(
 *             virtual_machine=instance.self_link,
 *             ip_address="10.0.0.2",
 *         )],
 *         site_to_site_data_transfer=True,
 *     ))
 * ```
 * ```csharp
 * 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 = "network",
 *         AutoCreateSubnetworks = false,
 *     });
 *     var subnetwork = new Gcp.Compute.Subnetwork("subnetwork", new()
 *     {
 *         Name = "subnet",
 *         IpCidrRange = "10.0.0.0/28",
 *         Region = "us-west1",
 *         Network = network.SelfLink,
 *     });
 *     var instance = new Gcp.Compute.Instance("instance", new()
 *     {
 *         Name = "instance",
 *         MachineType = "e2-medium",
 *         CanIpForward = true,
 *         Zone = "us-west1-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 = "hub",
 *         Description = "A sample hub",
 *         Labels =
 *         {
 *             { "label-two", "value-one" },
 *         },
 *     });
 *     var primary = new Gcp.NetworkConnectivity.Spoke("primary", new()
 *     {
 *         Name = "name",
 *         Location = "us-west1",
 *         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,
 *         },
 *     });
 * });
 * ```
 * ```go
 * package main
 * import (
 * 	"github.com/pulumi/pulumi-gcp/sdk/v7/go/gcp/compute"
 * 	"github.com/pulumi/pulumi-gcp/sdk/v7/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("network"),
 * 			AutoCreateSubnetworks: pulumi.Bool(false),
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		subnetwork, err := compute.NewSubnetwork(ctx, "subnetwork", &compute.SubnetworkArgs{
 * 			Name:        pulumi.String("subnet"),
 * 			IpCidrRange: pulumi.String("10.0.0.0/28"),
 * 			Region:      pulumi.String("us-west1"),
 * 			Network:     network.SelfLink,
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		instance, err := compute.NewInstance(ctx, "instance", &compute.InstanceArgs{
 * 			Name:         pulumi.String("instance"),
 * 			MachineType:  pulumi.String("e2-medium"),
 * 			CanIpForward: pulumi.Bool(true),
 * 			Zone:         pulumi.String("us-west1-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("hub"),
 * 			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("name"),
 * 			Location:    pulumi.String("us-west1"),
 * 			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),
 * 			},
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		return nil
 * 	})
 * }
 * ```
 * ```java
 * 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("network")
 *             .autoCreateSubnetworks(false)
 *             .build());
 *         var subnetwork = new Subnetwork("subnetwork", SubnetworkArgs.builder()
 *             .name("subnet")
 *             .ipCidrRange("10.0.0.0/28")
 *             .region("us-west1")
 *             .network(network.selfLink())
 *             .build());
 *         var instance = new Instance("instance", InstanceArgs.builder()
 *             .name("instance")
 *             .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()
 *             .name("hub")
 *             .description("A sample hub")
 *             .labels(Map.of("label-two", "value-one"))
 *             .build());
 *         var primary = new Spoke("primary", SpokeArgs.builder()
 *             .name("name")
 *             .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());
 *     }
 * }
 * ```
 * ```yaml
 * resources:
 *   network:
 *     type: gcp:compute:Network
 *     properties:
 *       name: network
 *       autoCreateSubnetworks: false
 *   subnetwork:
 *     type: gcp:compute:Subnetwork
 *     properties:
 *       name: subnet
 *       ipCidrRange: 10.0.0.0/28
 *       region: us-west1
 *       network: ${network.selfLink}
 *   instance:
 *     type: gcp:compute:Instance
 *     properties:
 *       name: instance
 *       machineType: e2-medium
 *       canIpForward: true
 *       zone: us-west1-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: hub
 *       description: A sample hub
 *       labels:
 *         label-two: value-one
 *   primary:
 *     type: gcp:networkconnectivity:Spoke
 *     properties:
 *       name: name
 *       location: us-west1
 *       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
 * ```
 * 
 * ## 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:
 * ```sh
 * $ pulumi import gcp:networkconnectivity/spoke:Spoke default projects/{{project}}/locations/{{location}}/spokes/{{name}}
 * ```
 * ```sh
 * $ pulumi import gcp:networkconnectivity/spoke:Spoke default {{project}}/{{location}}/{{name}}
 * ```
 * ```sh
 * $ pulumi import gcp:networkconnectivity/spoke:Spoke default {{location}}/{{name}}
 * ```
 */
public class Spoke internal constructor(
    override val javaResource: com.pulumi.gcp.networkconnectivity.Spoke,
) : KotlinCustomResource(javaResource, SpokeMapper) {
    /**
     * Output only. The time the spoke was created.
     */
    public val createTime: Output
        get() = javaResource.createTime().applyValue({ args0 -> args0 })

    /**
     * An optional description of the spoke.
     */
    public val description: Output?
        get() = javaResource.description().applyValue({ args0 ->
            args0.map({ args0 ->
                args0
            }).orElse(null)
        })

    /**
     * All of labels (key/value pairs) present on the resource in GCP, including the labels configured through Pulumi, other clients and services.
     */
    public val effectiveLabels: Output>
        get() = javaResource.effectiveLabels().applyValue({ args0 ->
            args0.map({ args0 ->
                args0.key.to(args0.value)
            }).toMap()
        })

    /**
     * Immutable. The URI of the hub that this spoke is attached to.
     */
    public val hub: Output
        get() = javaResource.hub().applyValue({ args0 -> args0 })

    /**
     * Optional labels in key:value format. For more information about labels, see [Requirements for
   * labels](https://cloud.google.com/resource-manager/docs/creating-managing-labels#requirements). **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.
     */
    public val labels: Output>?
        get() = javaResource.labels().applyValue({ args0 ->
            args0.map({ args0 ->
                args0.map({ args0 ->
                    args0.key.to(args0.value)
                }).toMap()
            }).orElse(null)
        })

    /**
     * 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.
     */
    public val linkedInterconnectAttachments: Output?
        get() = javaResource.linkedInterconnectAttachments().applyValue({ args0 ->
            args0.map({ args0 ->
                args0.let({ args0 -> spokeLinkedInterconnectAttachmentsToKotlin(args0) })
            }).orElse(null)
        })

    /**
     * The URIs of linked Router appliance resources
     */
    public val linkedRouterApplianceInstances: Output?
        get() = javaResource.linkedRouterApplianceInstances().applyValue({ args0 ->
            args0.map({ args0 ->
                args0.let({ args0 -> spokeLinkedRouterApplianceInstancesToKotlin(args0) })
            }).orElse(null)
        })

    /**
     * VPC network that is associated with the spoke.
     */
    public val linkedVpcNetwork: Output?
        get() = javaResource.linkedVpcNetwork().applyValue({ args0 ->
            args0.map({ args0 ->
                args0.let({ args0 -> spokeLinkedVpcNetworkToKotlin(args0) })
            }).orElse(null)
        })

    /**
     * The URIs of linked VPN tunnel resources
     */
    public val linkedVpnTunnels: Output?
        get() = javaResource.linkedVpnTunnels().applyValue({ args0 ->
            args0.map({ args0 ->
                args0.let({ args0 -> spokeLinkedVpnTunnelsToKotlin(args0) })
            }).orElse(null)
        })

    /**
     * The location for the resource
     */
    public val location: Output
        get() = javaResource.location().applyValue({ args0 -> args0 })

    /**
     * Immutable. The name of the spoke. Spoke names must be unique.
     */
    public val name: Output
        get() = javaResource.name().applyValue({ args0 -> args0 })

    /**
     * The project for the resource
     */
    public val project: Output
        get() = javaResource.project().applyValue({ args0 -> args0 })

    /**
     * The combination of labels configured directly on the resource and default labels configured on the provider.
     */
    public val pulumiLabels: Output>
        get() = javaResource.pulumiLabels().applyValue({ args0 ->
            args0.map({ args0 ->
                args0.key.to(args0.value)
            }).toMap()
        })

    /**
     * Output only. The current lifecycle state of this spoke. Possible values: STATE_UNSPECIFIED, CREATING, ACTIVE, DELETING
     */
    public val state: Output
        get() = javaResource.state().applyValue({ args0 -> args0 })

    /**
     * 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.
     */
    public val uniqueId: Output
        get() = javaResource.uniqueId().applyValue({ args0 -> args0 })

    /**
     * Output only. The time the spoke was last updated.
     */
    public val updateTime: Output
        get() = javaResource.updateTime().applyValue({ args0 -> args0 })
}

public object SpokeMapper : ResourceMapper {
    override fun supportsMappingOfType(javaResource: Resource): Boolean =
        com.pulumi.gcp.networkconnectivity.Spoke::class == javaResource::class

    override fun map(javaResource: Resource): Spoke = Spoke(
        javaResource as
            com.pulumi.gcp.networkconnectivity.Spoke,
    )
}

/**
 * @see [Spoke].
 * @param name The _unique_ name of the resulting resource.
 * @param block Builder for [Spoke].
 */
public suspend fun spoke(name: String, block: suspend SpokeResourceBuilder.() -> Unit): Spoke {
    val builder = SpokeResourceBuilder()
    builder.name(name)
    block(builder)
    return builder.build()
}

/**
 * @see [Spoke].
 * @param name The _unique_ name of the resulting resource.
 */
public fun spoke(name: String): Spoke {
    val builder = SpokeResourceBuilder()
    builder.name(name)
    return builder.build()
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy