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

com.pulumi.gcp.vmwareengine.kotlin.NetworkPeering.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.vmwareengine.kotlin

import com.pulumi.core.Output
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.Boolean
import kotlin.String
import kotlin.Suppress
import kotlin.Unit

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

    public var args: NetworkPeeringArgs = NetworkPeeringArgs()

    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 NetworkPeeringArgsBuilder.() -> Unit) {
        val builder = NetworkPeeringArgsBuilder()
        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(): NetworkPeering {
        val builtJavaResource = com.pulumi.gcp.vmwareengine.NetworkPeering(
            this.name,
            this.args.toJava(),
            this.opts.toJava(),
        )
        return NetworkPeering(builtJavaResource)
    }
}

/**
 * Represents a network peering resource. Network peerings are global resources.
 * To get more information about NetworkPeering, see:
 * * [API documentation](https://cloud.google.com/compute/docs/reference/rest/v1/networks/addPeering)
 * ## Example Usage
 * ### Vmware Engine Network Peering Ven
 * 
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as gcp from "@pulumi/gcp";
 * const network_peering_nw = new gcp.vmwareengine.Network("network-peering-nw", {
 *     name: "default-np-nw",
 *     location: "global",
 *     type: "STANDARD",
 * });
 * const network_peering_peer_nw = new gcp.vmwareengine.Network("network-peering-peer-nw", {
 *     name: "peer-np-nw",
 *     location: "global",
 *     type: "STANDARD",
 * });
 * const vmw_engine_network_peering = new gcp.vmwareengine.NetworkPeering("vmw-engine-network-peering", {
 *     name: "sample-network-peering",
 *     description: "Sample description",
 *     vmwareEngineNetwork: network_peering_nw.id,
 *     peerNetwork: network_peering_peer_nw.id,
 *     peerNetworkType: "VMWARE_ENGINE_NETWORK",
 *     exportCustomRoutes: false,
 *     importCustomRoutes: false,
 *     exportCustomRoutesWithPublicIp: false,
 *     importCustomRoutesWithPublicIp: false,
 * });
 * ```
 * ```python
 * import pulumi
 * import pulumi_gcp as gcp
 * network_peering_nw = gcp.vmwareengine.Network("network-peering-nw",
 *     name="default-np-nw",
 *     location="global",
 *     type="STANDARD")
 * network_peering_peer_nw = gcp.vmwareengine.Network("network-peering-peer-nw",
 *     name="peer-np-nw",
 *     location="global",
 *     type="STANDARD")
 * vmw_engine_network_peering = gcp.vmwareengine.NetworkPeering("vmw-engine-network-peering",
 *     name="sample-network-peering",
 *     description="Sample description",
 *     vmware_engine_network=network_peering_nw.id,
 *     peer_network=network_peering_peer_nw.id,
 *     peer_network_type="VMWARE_ENGINE_NETWORK",
 *     export_custom_routes=False,
 *     import_custom_routes=False,
 *     export_custom_routes_with_public_ip=False,
 *     import_custom_routes_with_public_ip=False)
 * ```
 * ```csharp
 * using System.Collections.Generic;
 * using System.Linq;
 * using Pulumi;
 * using Gcp = Pulumi.Gcp;
 * return await Deployment.RunAsync(() =>
 * {
 *     var network_peering_nw = new Gcp.VMwareEngine.Network("network-peering-nw", new()
 *     {
 *         Name = "default-np-nw",
 *         Location = "global",
 *         Type = "STANDARD",
 *     });
 *     var network_peering_peer_nw = new Gcp.VMwareEngine.Network("network-peering-peer-nw", new()
 *     {
 *         Name = "peer-np-nw",
 *         Location = "global",
 *         Type = "STANDARD",
 *     });
 *     var vmw_engine_network_peering = new Gcp.VMwareEngine.NetworkPeering("vmw-engine-network-peering", new()
 *     {
 *         Name = "sample-network-peering",
 *         Description = "Sample description",
 *         VmwareEngineNetwork = network_peering_nw.Id,
 *         PeerNetwork = network_peering_peer_nw.Id,
 *         PeerNetworkType = "VMWARE_ENGINE_NETWORK",
 *         ExportCustomRoutes = false,
 *         ImportCustomRoutes = false,
 *         ExportCustomRoutesWithPublicIp = false,
 *         ImportCustomRoutesWithPublicIp = false,
 *     });
 * });
 * ```
 * ```go
 * package main
 * import (
 * 	"github.com/pulumi/pulumi-gcp/sdk/v7/go/gcp/vmwareengine"
 * 	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
 * )
 * func main() {
 * 	pulumi.Run(func(ctx *pulumi.Context) error {
 * 		_, err := vmwareengine.NewNetwork(ctx, "network-peering-nw", &vmwareengine.NetworkArgs{
 * 			Name:     pulumi.String("default-np-nw"),
 * 			Location: pulumi.String("global"),
 * 			Type:     pulumi.String("STANDARD"),
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		_, err = vmwareengine.NewNetwork(ctx, "network-peering-peer-nw", &vmwareengine.NetworkArgs{
 * 			Name:     pulumi.String("peer-np-nw"),
 * 			Location: pulumi.String("global"),
 * 			Type:     pulumi.String("STANDARD"),
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		_, err = vmwareengine.NewNetworkPeering(ctx, "vmw-engine-network-peering", &vmwareengine.NetworkPeeringArgs{
 * 			Name:                           pulumi.String("sample-network-peering"),
 * 			Description:                    pulumi.String("Sample description"),
 * 			VmwareEngineNetwork:            network_peering_nw.ID(),
 * 			PeerNetwork:                    network_peering_peer_nw.ID(),
 * 			PeerNetworkType:                pulumi.String("VMWARE_ENGINE_NETWORK"),
 * 			ExportCustomRoutes:             pulumi.Bool(false),
 * 			ImportCustomRoutes:             pulumi.Bool(false),
 * 			ExportCustomRoutesWithPublicIp: pulumi.Bool(false),
 * 			ImportCustomRoutesWithPublicIp: pulumi.Bool(false),
 * 		})
 * 		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.vmwareengine.Network;
 * import com.pulumi.gcp.vmwareengine.NetworkArgs;
 * import com.pulumi.gcp.vmwareengine.NetworkPeering;
 * import com.pulumi.gcp.vmwareengine.NetworkPeeringArgs;
 * 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_peering_nw = new Network("network-peering-nw", NetworkArgs.builder()
 *             .name("default-np-nw")
 *             .location("global")
 *             .type("STANDARD")
 *             .build());
 *         var network_peering_peer_nw = new Network("network-peering-peer-nw", NetworkArgs.builder()
 *             .name("peer-np-nw")
 *             .location("global")
 *             .type("STANDARD")
 *             .build());
 *         var vmw_engine_network_peering = new NetworkPeering("vmw-engine-network-peering", NetworkPeeringArgs.builder()
 *             .name("sample-network-peering")
 *             .description("Sample description")
 *             .vmwareEngineNetwork(network_peering_nw.id())
 *             .peerNetwork(network_peering_peer_nw.id())
 *             .peerNetworkType("VMWARE_ENGINE_NETWORK")
 *             .exportCustomRoutes(false)
 *             .importCustomRoutes(false)
 *             .exportCustomRoutesWithPublicIp(false)
 *             .importCustomRoutesWithPublicIp(false)
 *             .build());
 *     }
 * }
 * ```
 * ```yaml
 * resources:
 *   network-peering-nw:
 *     type: gcp:vmwareengine:Network
 *     properties:
 *       name: default-np-nw
 *       location: global
 *       type: STANDARD
 *   network-peering-peer-nw:
 *     type: gcp:vmwareengine:Network
 *     properties:
 *       name: peer-np-nw
 *       location: global
 *       type: STANDARD
 *   vmw-engine-network-peering:
 *     type: gcp:vmwareengine:NetworkPeering
 *     properties:
 *       name: sample-network-peering
 *       description: Sample description
 *       vmwareEngineNetwork: ${["network-peering-nw"].id}
 *       peerNetwork: ${["network-peering-peer-nw"].id}
 *       peerNetworkType: VMWARE_ENGINE_NETWORK
 *       exportCustomRoutes: false
 *       importCustomRoutes: false
 *       exportCustomRoutesWithPublicIp: false
 *       importCustomRoutesWithPublicIp: false
 * ```
 * 
 * ### Vmware Engine Network Peering Standard
 * 
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as gcp from "@pulumi/gcp";
 * const network_peering_vpc = new gcp.compute.Network("network-peering-vpc", {name: "default-vpc"});
 * const network_peering_standard_nw = new gcp.vmwareengine.Network("network-peering-standard-nw", {
 *     name: "default-standard-nw-np",
 *     location: "global",
 *     type: "STANDARD",
 * });
 * const vmw_engine_network_peering = new gcp.vmwareengine.NetworkPeering("vmw-engine-network-peering", {
 *     name: "sample-network-peering",
 *     description: "Sample description",
 *     peerNetwork: network_peering_vpc.id,
 *     peerNetworkType: "STANDARD",
 *     vmwareEngineNetwork: network_peering_standard_nw.id,
 * });
 * ```
 * ```python
 * import pulumi
 * import pulumi_gcp as gcp
 * network_peering_vpc = gcp.compute.Network("network-peering-vpc", name="default-vpc")
 * network_peering_standard_nw = gcp.vmwareengine.Network("network-peering-standard-nw",
 *     name="default-standard-nw-np",
 *     location="global",
 *     type="STANDARD")
 * vmw_engine_network_peering = gcp.vmwareengine.NetworkPeering("vmw-engine-network-peering",
 *     name="sample-network-peering",
 *     description="Sample description",
 *     peer_network=network_peering_vpc.id,
 *     peer_network_type="STANDARD",
 *     vmware_engine_network=network_peering_standard_nw.id)
 * ```
 * ```csharp
 * using System.Collections.Generic;
 * using System.Linq;
 * using Pulumi;
 * using Gcp = Pulumi.Gcp;
 * return await Deployment.RunAsync(() =>
 * {
 *     var network_peering_vpc = new Gcp.Compute.Network("network-peering-vpc", new()
 *     {
 *         Name = "default-vpc",
 *     });
 *     var network_peering_standard_nw = new Gcp.VMwareEngine.Network("network-peering-standard-nw", new()
 *     {
 *         Name = "default-standard-nw-np",
 *         Location = "global",
 *         Type = "STANDARD",
 *     });
 *     var vmw_engine_network_peering = new Gcp.VMwareEngine.NetworkPeering("vmw-engine-network-peering", new()
 *     {
 *         Name = "sample-network-peering",
 *         Description = "Sample description",
 *         PeerNetwork = network_peering_vpc.Id,
 *         PeerNetworkType = "STANDARD",
 *         VmwareEngineNetwork = network_peering_standard_nw.Id,
 *     });
 * });
 * ```
 * ```go
 * package main
 * import (
 * 	"github.com/pulumi/pulumi-gcp/sdk/v7/go/gcp/compute"
 * 	"github.com/pulumi/pulumi-gcp/sdk/v7/go/gcp/vmwareengine"
 * 	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
 * )
 * func main() {
 * 	pulumi.Run(func(ctx *pulumi.Context) error {
 * 		_, err := compute.NewNetwork(ctx, "network-peering-vpc", &compute.NetworkArgs{
 * 			Name: pulumi.String("default-vpc"),
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		_, err = vmwareengine.NewNetwork(ctx, "network-peering-standard-nw", &vmwareengine.NetworkArgs{
 * 			Name:     pulumi.String("default-standard-nw-np"),
 * 			Location: pulumi.String("global"),
 * 			Type:     pulumi.String("STANDARD"),
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		_, err = vmwareengine.NewNetworkPeering(ctx, "vmw-engine-network-peering", &vmwareengine.NetworkPeeringArgs{
 * 			Name:                pulumi.String("sample-network-peering"),
 * 			Description:         pulumi.String("Sample description"),
 * 			PeerNetwork:         network_peering_vpc.ID(),
 * 			PeerNetworkType:     pulumi.String("STANDARD"),
 * 			VmwareEngineNetwork: network_peering_standard_nw.ID(),
 * 		})
 * 		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.vmwareengine.Network;
 * import com.pulumi.gcp.vmwareengine.NetworkArgs;
 * import com.pulumi.gcp.vmwareengine.NetworkPeering;
 * import com.pulumi.gcp.vmwareengine.NetworkPeeringArgs;
 * 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_peering_vpc = new Network("network-peering-vpc", NetworkArgs.builder()
 *             .name("default-vpc")
 *             .build());
 *         var network_peering_standard_nw = new Network("network-peering-standard-nw", NetworkArgs.builder()
 *             .name("default-standard-nw-np")
 *             .location("global")
 *             .type("STANDARD")
 *             .build());
 *         var vmw_engine_network_peering = new NetworkPeering("vmw-engine-network-peering", NetworkPeeringArgs.builder()
 *             .name("sample-network-peering")
 *             .description("Sample description")
 *             .peerNetwork(network_peering_vpc.id())
 *             .peerNetworkType("STANDARD")
 *             .vmwareEngineNetwork(network_peering_standard_nw.id())
 *             .build());
 *     }
 * }
 * ```
 * ```yaml
 * resources:
 *   network-peering-vpc:
 *     type: gcp:compute:Network
 *     properties:
 *       name: default-vpc
 *   network-peering-standard-nw:
 *     type: gcp:vmwareengine:Network
 *     properties:
 *       name: default-standard-nw-np
 *       location: global
 *       type: STANDARD
 *   vmw-engine-network-peering:
 *     type: gcp:vmwareengine:NetworkPeering
 *     properties:
 *       name: sample-network-peering
 *       description: Sample description
 *       peerNetwork: ${["network-peering-vpc"].id}
 *       peerNetworkType: STANDARD
 *       vmwareEngineNetwork: ${["network-peering-standard-nw"].id}
 * ```
 * 
 * ## Import
 * NetworkPeering can be imported using any of these accepted formats:
 * * `projects/{{project}}/locations/global/networkPeerings/{{name}}`
 * * `{{project}}/{{name}}`
 * * `{{name}}`
 * When using the `pulumi import` command, NetworkPeering can be imported using one of the formats above. For example:
 * ```sh
 * $ pulumi import gcp:vmwareengine/networkPeering:NetworkPeering default projects/{{project}}/locations/global/networkPeerings/{{name}}
 * ```
 * ```sh
 * $ pulumi import gcp:vmwareengine/networkPeering:NetworkPeering default {{project}}/{{name}}
 * ```
 * ```sh
 * $ pulumi import gcp:vmwareengine/networkPeering:NetworkPeering default {{name}}
 * ```
 */
public class NetworkPeering internal constructor(
    override val javaResource: com.pulumi.gcp.vmwareengine.NetworkPeering,
) : KotlinCustomResource(javaResource, NetworkPeeringMapper) {
    /**
     * Creation time of this resource.
     * A timestamp in RFC3339 UTC "Zulu" format, with nanosecond resolution and
     * up to nine fractional digits. Examples: "2014-10-02T15:01:23Z" and "2014-10-02T15:01:23.045123456Z".
     */
    public val createTime: Output
        get() = javaResource.createTime().applyValue({ args0 -> args0 })

    /**
     * User-provided description for this network peering.
     */
    public val description: Output?
        get() = javaResource.description().applyValue({ args0 ->
            args0.map({ args0 ->
                args0
            }).orElse(null)
        })

    /**
     * True if custom routes are exported to the peered network; false otherwise.
     */
    public val exportCustomRoutes: Output?
        get() = javaResource.exportCustomRoutes().applyValue({ args0 ->
            args0.map({ args0 ->
                args0
            }).orElse(null)
        })

    /**
     * True if all subnet routes with a public IP address range are exported; false otherwise.
     */
    public val exportCustomRoutesWithPublicIp: Output?
        get() = javaResource.exportCustomRoutesWithPublicIp().applyValue({ args0 ->
            args0.map({ args0 ->
                args0
            }).orElse(null)
        })

    /**
     * True if custom routes are imported from the peered network; false otherwise.
     */
    public val importCustomRoutes: Output?
        get() = javaResource.importCustomRoutes().applyValue({ args0 ->
            args0.map({ args0 ->
                args0
            }).orElse(null)
        })

    /**
     * True if custom routes are imported from the peered network; false otherwise.
     */
    public val importCustomRoutesWithPublicIp: Output?
        get() = javaResource.importCustomRoutesWithPublicIp().applyValue({ args0 ->
            args0.map({ args0 ->
                args0
            }).orElse(null)
        })

    /**
     * The ID of the Network Peering.
     * - - -
     */
    public val name: Output
        get() = javaResource.name().applyValue({ args0 -> args0 })

    /**
     * The relative resource name of the network to peer with a standard VMware Engine network.
     * The provided network can be a consumer VPC network or another standard VMware Engine network.
     */
    public val peerNetwork: Output
        get() = javaResource.peerNetwork().applyValue({ args0 -> args0 })

    /**
     * The type of the network to peer with the VMware Engine network.
     * Possible values are: `STANDARD`, `VMWARE_ENGINE_NETWORK`, `PRIVATE_SERVICES_ACCESS`, `NETAPP_CLOUD_VOLUMES`, `THIRD_PARTY_SERVICE`, `DELL_POWERSCALE`.
     */
    public val peerNetworkType: Output
        get() = javaResource.peerNetworkType().applyValue({ args0 -> args0 })

    /**
     * The ID of the project in which the resource belongs.
     * If it is not provided, the provider project is used.
     */
    public val project: Output
        get() = javaResource.project().applyValue({ args0 -> args0 })

    /**
     * State of the network peering.
     * This field has a value of 'ACTIVE' when there's a matching configuration in the peer network.
     * New values may be added to this enum when appropriate.
     */
    public val state: Output
        get() = javaResource.state().applyValue({ args0 -> args0 })

    /**
     * Details about the current state of the network peering.
     */
    public val stateDetails: Output
        get() = javaResource.stateDetails().applyValue({ args0 -> args0 })

    /**
     * System-generated unique identifier for the resource.
     */
    public val uid: Output
        get() = javaResource.uid().applyValue({ args0 -> args0 })

    /**
     * Last updated time of this resource.
     * A timestamp in RFC3339 UTC "Zulu" format, with nanosecond resolution and up to nine
     * fractional digits. Examples: "2014-10-02T15:01:23Z" and "2014-10-02T15:01:23.045123456Z".
     */
    public val updateTime: Output
        get() = javaResource.updateTime().applyValue({ args0 -> args0 })

    /**
     * The relative resource name of the VMware Engine network. Specify the name in the following form:
     * projects/{project}/locations/{location}/vmwareEngineNetworks/{vmwareEngineNetworkId} where {project}
     * can either be a project number or a project ID.
     */
    public val vmwareEngineNetwork: Output
        get() = javaResource.vmwareEngineNetwork().applyValue({ args0 -> args0 })

    /**
     * The canonical name of the VMware Engine network in the form:
     * projects/{project_number}/locations/{location}/vmwareEngineNetworks/{vmwareEngineNetworkId}
     */
    public val vmwareEngineNetworkCanonical: Output
        get() = javaResource.vmwareEngineNetworkCanonical().applyValue({ args0 -> args0 })
}

public object NetworkPeeringMapper : ResourceMapper {
    override fun supportsMappingOfType(javaResource: Resource): Boolean =
        com.pulumi.gcp.vmwareengine.NetworkPeering::class == javaResource::class

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

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

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




© 2015 - 2024 Weber Informatics LLC | Privacy Policy