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

com.pulumi.gcp.datastream.kotlin.PrivateConnectionArgs.kt Maven / Gradle / Ivy

@file:Suppress("NAME_SHADOWING", "DEPRECATION")

package com.pulumi.gcp.datastream.kotlin

import com.pulumi.core.Output
import com.pulumi.core.Output.of
import com.pulumi.gcp.datastream.PrivateConnectionArgs.builder
import com.pulumi.gcp.datastream.kotlin.inputs.PrivateConnectionVpcPeeringConfigArgs
import com.pulumi.gcp.datastream.kotlin.inputs.PrivateConnectionVpcPeeringConfigArgsBuilder
import com.pulumi.kotlin.ConvertibleToJava
import com.pulumi.kotlin.PulumiTagMarker
import com.pulumi.kotlin.applySuspend
import kotlin.Boolean
import kotlin.Pair
import kotlin.String
import kotlin.Suppress
import kotlin.Unit
import kotlin.collections.Map
import kotlin.jvm.JvmName

/**
 * The PrivateConnection resource is used to establish private connectivity between Datastream and a customer's network.
 * To get more information about PrivateConnection, see:
 * * [API documentation](https://cloud.google.com/datastream/docs/reference/rest/v1/projects.locations.privateConnections)
 * * How-to Guides
 *     * [Official Documentation](https://cloud.google.com/datastream/docs/create-a-private-connectivity-configuration)
 * ## Example Usage
 * ### Datastream Private Connection Full
 * 
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as gcp from "@pulumi/gcp";
 * const defaultNetwork = new gcp.compute.Network("default", {name: "my-network"});
 * const _default = new gcp.datastream.PrivateConnection("default", {
 *     displayName: "Connection profile",
 *     location: "us-central1",
 *     privateConnectionId: "my-connection",
 *     labels: {
 *         key: "value",
 *     },
 *     vpcPeeringConfig: {
 *         vpc: defaultNetwork.id,
 *         subnet: "10.0.0.0/29",
 *     },
 * });
 * ```
 * ```python
 * import pulumi
 * import pulumi_gcp as gcp
 * default_network = gcp.compute.Network("default", name="my-network")
 * default = gcp.datastream.PrivateConnection("default",
 *     display_name="Connection profile",
 *     location="us-central1",
 *     private_connection_id="my-connection",
 *     labels={
 *         "key": "value",
 *     },
 *     vpc_peering_config={
 *         "vpc": default_network.id,
 *         "subnet": "10.0.0.0/29",
 *     })
 * ```
 * ```csharp
 * using System.Collections.Generic;
 * using System.Linq;
 * using Pulumi;
 * using Gcp = Pulumi.Gcp;
 * return await Deployment.RunAsync(() =>
 * {
 *     var defaultNetwork = new Gcp.Compute.Network("default", new()
 *     {
 *         Name = "my-network",
 *     });
 *     var @default = new Gcp.Datastream.PrivateConnection("default", new()
 *     {
 *         DisplayName = "Connection profile",
 *         Location = "us-central1",
 *         PrivateConnectionId = "my-connection",
 *         Labels =
 *         {
 *             { "key", "value" },
 *         },
 *         VpcPeeringConfig = new Gcp.Datastream.Inputs.PrivateConnectionVpcPeeringConfigArgs
 *         {
 *             Vpc = defaultNetwork.Id,
 *             Subnet = "10.0.0.0/29",
 *         },
 *     });
 * });
 * ```
 * ```go
 * package main
 * import (
 * 	"github.com/pulumi/pulumi-gcp/sdk/v8/go/gcp/compute"
 * 	"github.com/pulumi/pulumi-gcp/sdk/v8/go/gcp/datastream"
 * 	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
 * )
 * func main() {
 * 	pulumi.Run(func(ctx *pulumi.Context) error {
 * 		defaultNetwork, err := compute.NewNetwork(ctx, "default", &compute.NetworkArgs{
 * 			Name: pulumi.String("my-network"),
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		_, err = datastream.NewPrivateConnection(ctx, "default", &datastream.PrivateConnectionArgs{
 * 			DisplayName:         pulumi.String("Connection profile"),
 * 			Location:            pulumi.String("us-central1"),
 * 			PrivateConnectionId: pulumi.String("my-connection"),
 * 			Labels: pulumi.StringMap{
 * 				"key": pulumi.String("value"),
 * 			},
 * 			VpcPeeringConfig: &datastream.PrivateConnectionVpcPeeringConfigArgs{
 * 				Vpc:    defaultNetwork.ID(),
 * 				Subnet: pulumi.String("10.0.0.0/29"),
 * 			},
 * 		})
 * 		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.datastream.PrivateConnection;
 * import com.pulumi.gcp.datastream.PrivateConnectionArgs;
 * import com.pulumi.gcp.datastream.inputs.PrivateConnectionVpcPeeringConfigArgs;
 * 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 defaultNetwork = new Network("defaultNetwork", NetworkArgs.builder()
 *             .name("my-network")
 *             .build());
 *         var default_ = new PrivateConnection("default", PrivateConnectionArgs.builder()
 *             .displayName("Connection profile")
 *             .location("us-central1")
 *             .privateConnectionId("my-connection")
 *             .labels(Map.of("key", "value"))
 *             .vpcPeeringConfig(PrivateConnectionVpcPeeringConfigArgs.builder()
 *                 .vpc(defaultNetwork.id())
 *                 .subnet("10.0.0.0/29")
 *                 .build())
 *             .build());
 *     }
 * }
 * ```
 * ```yaml
 * resources:
 *   default:
 *     type: gcp:datastream:PrivateConnection
 *     properties:
 *       displayName: Connection profile
 *       location: us-central1
 *       privateConnectionId: my-connection
 *       labels:
 *         key: value
 *       vpcPeeringConfig:
 *         vpc: ${defaultNetwork.id}
 *         subnet: 10.0.0.0/29
 *   defaultNetwork:
 *     type: gcp:compute:Network
 *     name: default
 *     properties:
 *       name: my-network
 * ```
 * 
 * ## Import
 * PrivateConnection can be imported using any of these accepted formats:
 * * `projects/{{project}}/locations/{{location}}/privateConnections/{{private_connection_id}}`
 * * `{{project}}/{{location}}/{{private_connection_id}}`
 * * `{{location}}/{{private_connection_id}}`
 * When using the `pulumi import` command, PrivateConnection can be imported using one of the formats above. For example:
 * ```sh
 * $ pulumi import gcp:datastream/privateConnection:PrivateConnection default projects/{{project}}/locations/{{location}}/privateConnections/{{private_connection_id}}
 * ```
 * ```sh
 * $ pulumi import gcp:datastream/privateConnection:PrivateConnection default {{project}}/{{location}}/{{private_connection_id}}
 * ```
 * ```sh
 * $ pulumi import gcp:datastream/privateConnection:PrivateConnection default {{location}}/{{private_connection_id}}
 * ```
 * @property createWithoutValidation If set to true, will skip validations.
 * @property displayName Display name.
 * @property labels 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.
 * @property location The name of the location this private connection is located in.
 * @property privateConnectionId The private connectivity identifier.
 * @property project
 * @property vpcPeeringConfig The VPC Peering configuration is used to create VPC peering
 * between Datastream and the consumer's VPC.
 * Structure is documented below.
 */
public data class PrivateConnectionArgs(
    public val createWithoutValidation: Output? = null,
    public val displayName: Output? = null,
    public val labels: Output>? = null,
    public val location: Output? = null,
    public val privateConnectionId: Output? = null,
    public val project: Output? = null,
    public val vpcPeeringConfig: Output? = null,
) : ConvertibleToJava {
    override fun toJava(): com.pulumi.gcp.datastream.PrivateConnectionArgs =
        com.pulumi.gcp.datastream.PrivateConnectionArgs.builder()
            .createWithoutValidation(createWithoutValidation?.applyValue({ args0 -> args0 }))
            .displayName(displayName?.applyValue({ args0 -> args0 }))
            .labels(labels?.applyValue({ args0 -> args0.map({ args0 -> args0.key.to(args0.value) }).toMap() }))
            .location(location?.applyValue({ args0 -> args0 }))
            .privateConnectionId(privateConnectionId?.applyValue({ args0 -> args0 }))
            .project(project?.applyValue({ args0 -> args0 }))
            .vpcPeeringConfig(
                vpcPeeringConfig?.applyValue({ args0 ->
                    args0.let({ args0 ->
                        args0.toJava()
                    })
                }),
            ).build()
}

/**
 * Builder for [PrivateConnectionArgs].
 */
@PulumiTagMarker
public class PrivateConnectionArgsBuilder internal constructor() {
    private var createWithoutValidation: Output? = null

    private var displayName: Output? = null

    private var labels: Output>? = null

    private var location: Output? = null

    private var privateConnectionId: Output? = null

    private var project: Output? = null

    private var vpcPeeringConfig: Output? = null

    /**
     * @param value If set to true, will skip validations.
     */
    @JvmName("fnrrnhpgsnsakavf")
    public suspend fun createWithoutValidation(`value`: Output) {
        this.createWithoutValidation = value
    }

    /**
     * @param value Display name.
     */
    @JvmName("weiyqnccvyfgiwfi")
    public suspend fun displayName(`value`: Output) {
        this.displayName = value
    }

    /**
     * @param value 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.
     */
    @JvmName("jgoifjqcauynargy")
    public suspend fun labels(`value`: Output>) {
        this.labels = value
    }

    /**
     * @param value The name of the location this private connection is located in.
     */
    @JvmName("uphlauyuprdgivip")
    public suspend fun location(`value`: Output) {
        this.location = value
    }

    /**
     * @param value The private connectivity identifier.
     */
    @JvmName("dugggvdhugdrlbel")
    public suspend fun privateConnectionId(`value`: Output) {
        this.privateConnectionId = value
    }

    /**
     * @param value
     */
    @JvmName("cegcfylxgawitfdv")
    public suspend fun project(`value`: Output) {
        this.project = value
    }

    /**
     * @param value The VPC Peering configuration is used to create VPC peering
     * between Datastream and the consumer's VPC.
     * Structure is documented below.
     */
    @JvmName("kfkcmnqngxoxcctu")
    public suspend fun vpcPeeringConfig(`value`: Output) {
        this.vpcPeeringConfig = value
    }

    /**
     * @param value If set to true, will skip validations.
     */
    @JvmName("ettkrdoxasfssgof")
    public suspend fun createWithoutValidation(`value`: Boolean?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.createWithoutValidation = mapped
    }

    /**
     * @param value Display name.
     */
    @JvmName("shauvkkrdvmoeiqt")
    public suspend fun displayName(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.displayName = mapped
    }

    /**
     * @param value 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.
     */
    @JvmName("tuhsqfijdejqjrpp")
    public suspend fun labels(`value`: Map?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.labels = mapped
    }

    /**
     * @param values 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.
     */
    @JvmName("oxbngmnpailbjigs")
    public fun labels(vararg values: Pair) {
        val toBeMapped = values.toMap()
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.labels = mapped
    }

    /**
     * @param value The name of the location this private connection is located in.
     */
    @JvmName("idrcpbboyartmirt")
    public suspend fun location(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.location = mapped
    }

    /**
     * @param value The private connectivity identifier.
     */
    @JvmName("pyloskmlmmksxxog")
    public suspend fun privateConnectionId(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.privateConnectionId = mapped
    }

    /**
     * @param value
     */
    @JvmName("aqfquuffbfyqwfjl")
    public suspend fun project(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.project = mapped
    }

    /**
     * @param value The VPC Peering configuration is used to create VPC peering
     * between Datastream and the consumer's VPC.
     * Structure is documented below.
     */
    @JvmName("mxvxclniwigwlxxm")
    public suspend fun vpcPeeringConfig(`value`: PrivateConnectionVpcPeeringConfigArgs?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.vpcPeeringConfig = mapped
    }

    /**
     * @param argument The VPC Peering configuration is used to create VPC peering
     * between Datastream and the consumer's VPC.
     * Structure is documented below.
     */
    @JvmName("tuxvdcsoqdbpruna")
    public suspend fun vpcPeeringConfig(argument: suspend PrivateConnectionVpcPeeringConfigArgsBuilder.() -> Unit) {
        val toBeMapped = PrivateConnectionVpcPeeringConfigArgsBuilder().applySuspend {
            argument()
        }.build()
        val mapped = of(toBeMapped)
        this.vpcPeeringConfig = mapped
    }

    internal fun build(): PrivateConnectionArgs = PrivateConnectionArgs(
        createWithoutValidation = createWithoutValidation,
        displayName = displayName,
        labels = labels,
        location = location,
        privateConnectionId = privateConnectionId,
        project = project,
        vpcPeeringConfig = vpcPeeringConfig,
    )
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy