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

com.pulumi.gcp.vpcaccess.kotlin.ConnectorArgs.kt Maven / Gradle / Ivy

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

package com.pulumi.gcp.vpcaccess.kotlin

import com.pulumi.core.Output
import com.pulumi.core.Output.of
import com.pulumi.gcp.vpcaccess.ConnectorArgs.builder
import com.pulumi.gcp.vpcaccess.kotlin.inputs.ConnectorSubnetArgs
import com.pulumi.gcp.vpcaccess.kotlin.inputs.ConnectorSubnetArgsBuilder
import com.pulumi.kotlin.ConvertibleToJava
import com.pulumi.kotlin.PulumiTagMarker
import com.pulumi.kotlin.applySuspend
import kotlin.Int
import kotlin.String
import kotlin.Suppress
import kotlin.Unit
import kotlin.jvm.JvmName

/**
 * Serverless VPC Access connector resource.
 * To get more information about Connector, see:
 * * [API documentation](https://cloud.google.com/vpc/docs/reference/vpcaccess/rest/v1/projects.locations.connectors)
 * * How-to Guides
 *     * [Configuring Serverless VPC Access](https://cloud.google.com/vpc/docs/configure-serverless-vpc-access)
 * ## Example Usage
 * ### Vpc Access Connector
 * 
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as gcp from "@pulumi/gcp";
 * const connector = new gcp.vpcaccess.Connector("connector", {
 *     name: "vpc-con",
 *     ipCidrRange: "10.8.0.0/28",
 *     network: "default",
 *     minInstances: 2,
 *     maxInstances: 3,
 * });
 * ```
 * ```python
 * import pulumi
 * import pulumi_gcp as gcp
 * connector = gcp.vpcaccess.Connector("connector",
 *     name="vpc-con",
 *     ip_cidr_range="10.8.0.0/28",
 *     network="default",
 *     min_instances=2,
 *     max_instances=3)
 * ```
 * ```csharp
 * using System.Collections.Generic;
 * using System.Linq;
 * using Pulumi;
 * using Gcp = Pulumi.Gcp;
 * return await Deployment.RunAsync(() =>
 * {
 *     var connector = new Gcp.VpcAccess.Connector("connector", new()
 *     {
 *         Name = "vpc-con",
 *         IpCidrRange = "10.8.0.0/28",
 *         Network = "default",
 *         MinInstances = 2,
 *         MaxInstances = 3,
 *     });
 * });
 * ```
 * ```go
 * package main
 * import (
 * 	"github.com/pulumi/pulumi-gcp/sdk/v8/go/gcp/vpcaccess"
 * 	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
 * )
 * func main() {
 * 	pulumi.Run(func(ctx *pulumi.Context) error {
 * 		_, err := vpcaccess.NewConnector(ctx, "connector", &vpcaccess.ConnectorArgs{
 * 			Name:         pulumi.String("vpc-con"),
 * 			IpCidrRange:  pulumi.String("10.8.0.0/28"),
 * 			Network:      pulumi.String("default"),
 * 			MinInstances: pulumi.Int(2),
 * 			MaxInstances: pulumi.Int(3),
 * 		})
 * 		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.vpcaccess.Connector;
 * import com.pulumi.gcp.vpcaccess.ConnectorArgs;
 * 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 connector = new Connector("connector", ConnectorArgs.builder()
 *             .name("vpc-con")
 *             .ipCidrRange("10.8.0.0/28")
 *             .network("default")
 *             .minInstances(2)
 *             .maxInstances(3)
 *             .build());
 *     }
 * }
 * ```
 * ```yaml
 * resources:
 *   connector:
 *     type: gcp:vpcaccess:Connector
 *     properties:
 *       name: vpc-con
 *       ipCidrRange: 10.8.0.0/28
 *       network: default
 *       minInstances: 2
 *       maxInstances: 3
 * ```
 * 
 * ### Vpc Access Connector Shared Vpc
 * 
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as gcp from "@pulumi/gcp";
 * const customTest = new gcp.compute.Subnetwork("custom_test", {
 *     name: "vpc-con",
 *     ipCidrRange: "10.2.0.0/28",
 *     region: "us-central1",
 *     network: "default",
 * });
 * const connector = new gcp.vpcaccess.Connector("connector", {
 *     name: "vpc-con",
 *     subnet: {
 *         name: customTest.name,
 *     },
 *     machineType: "e2-standard-4",
 *     minInstances: 2,
 *     maxInstances: 3,
 * });
 * ```
 * ```python
 * import pulumi
 * import pulumi_gcp as gcp
 * custom_test = gcp.compute.Subnetwork("custom_test",
 *     name="vpc-con",
 *     ip_cidr_range="10.2.0.0/28",
 *     region="us-central1",
 *     network="default")
 * connector = gcp.vpcaccess.Connector("connector",
 *     name="vpc-con",
 *     subnet={
 *         "name": custom_test.name,
 *     },
 *     machine_type="e2-standard-4",
 *     min_instances=2,
 *     max_instances=3)
 * ```
 * ```csharp
 * using System.Collections.Generic;
 * using System.Linq;
 * using Pulumi;
 * using Gcp = Pulumi.Gcp;
 * return await Deployment.RunAsync(() =>
 * {
 *     var customTest = new Gcp.Compute.Subnetwork("custom_test", new()
 *     {
 *         Name = "vpc-con",
 *         IpCidrRange = "10.2.0.0/28",
 *         Region = "us-central1",
 *         Network = "default",
 *     });
 *     var connector = new Gcp.VpcAccess.Connector("connector", new()
 *     {
 *         Name = "vpc-con",
 *         Subnet = new Gcp.VpcAccess.Inputs.ConnectorSubnetArgs
 *         {
 *             Name = customTest.Name,
 *         },
 *         MachineType = "e2-standard-4",
 *         MinInstances = 2,
 *         MaxInstances = 3,
 *     });
 * });
 * ```
 * ```go
 * package main
 * import (
 * 	"github.com/pulumi/pulumi-gcp/sdk/v8/go/gcp/compute"
 * 	"github.com/pulumi/pulumi-gcp/sdk/v8/go/gcp/vpcaccess"
 * 	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
 * )
 * func main() {
 * 	pulumi.Run(func(ctx *pulumi.Context) error {
 * 		customTest, err := compute.NewSubnetwork(ctx, "custom_test", &compute.SubnetworkArgs{
 * 			Name:        pulumi.String("vpc-con"),
 * 			IpCidrRange: pulumi.String("10.2.0.0/28"),
 * 			Region:      pulumi.String("us-central1"),
 * 			Network:     pulumi.String("default"),
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		_, err = vpcaccess.NewConnector(ctx, "connector", &vpcaccess.ConnectorArgs{
 * 			Name: pulumi.String("vpc-con"),
 * 			Subnet: &vpcaccess.ConnectorSubnetArgs{
 * 				Name: customTest.Name,
 * 			},
 * 			MachineType:  pulumi.String("e2-standard-4"),
 * 			MinInstances: pulumi.Int(2),
 * 			MaxInstances: pulumi.Int(3),
 * 		})
 * 		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.Subnetwork;
 * import com.pulumi.gcp.compute.SubnetworkArgs;
 * import com.pulumi.gcp.vpcaccess.Connector;
 * import com.pulumi.gcp.vpcaccess.ConnectorArgs;
 * import com.pulumi.gcp.vpcaccess.inputs.ConnectorSubnetArgs;
 * 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 customTest = new Subnetwork("customTest", SubnetworkArgs.builder()
 *             .name("vpc-con")
 *             .ipCidrRange("10.2.0.0/28")
 *             .region("us-central1")
 *             .network("default")
 *             .build());
 *         var connector = new Connector("connector", ConnectorArgs.builder()
 *             .name("vpc-con")
 *             .subnet(ConnectorSubnetArgs.builder()
 *                 .name(customTest.name())
 *                 .build())
 *             .machineType("e2-standard-4")
 *             .minInstances(2)
 *             .maxInstances(3)
 *             .build());
 *     }
 * }
 * ```
 * ```yaml
 * resources:
 *   connector:
 *     type: gcp:vpcaccess:Connector
 *     properties:
 *       name: vpc-con
 *       subnet:
 *         name: ${customTest.name}
 *       machineType: e2-standard-4
 *       minInstances: 2
 *       maxInstances: 3
 *   customTest:
 *     type: gcp:compute:Subnetwork
 *     name: custom_test
 *     properties:
 *       name: vpc-con
 *       ipCidrRange: 10.2.0.0/28
 *       region: us-central1
 *       network: default
 * ```
 * 
 * ## Import
 * Connector can be imported using any of these accepted formats:
 * * `projects/{{project}}/locations/{{region}}/connectors/{{name}}`
 * * `{{project}}/{{region}}/{{name}}`
 * * `{{region}}/{{name}}`
 * * `{{name}}`
 * When using the `pulumi import` command, Connector can be imported using one of the formats above. For example:
 * ```sh
 * $ pulumi import gcp:vpcaccess/connector:Connector default projects/{{project}}/locations/{{region}}/connectors/{{name}}
 * ```
 * ```sh
 * $ pulumi import gcp:vpcaccess/connector:Connector default {{project}}/{{region}}/{{name}}
 * ```
 * ```sh
 * $ pulumi import gcp:vpcaccess/connector:Connector default {{region}}/{{name}}
 * ```
 * ```sh
 * $ pulumi import gcp:vpcaccess/connector:Connector default {{name}}
 * ```
 * @property ipCidrRange The range of internal addresses that follows RFC 4632 notation. Example: `10.132.0.0/28`.
 * @property machineType Machine type of VM Instance underlying connector. Default is e2-micro
 * @property maxInstances Maximum value of instances in autoscaling group underlying the connector. Value must be between 3 and 10, inclusive. Must be
 * higher than the value specified by min_instances.
 * @property maxThroughput Maximum throughput of the connector in Mbps, must be greater than `min_throughput`. Default is 300. Refers to the expected throughput
 * when using an e2-micro machine type. Value must be a multiple of 100 from 300 through 1000. Must be higher than the value specified by
 * min_throughput. Only one of `max_throughput` and `max_instances` can be specified. The use of max_throughput is discouraged in favor of max_instances.
 * @property minInstances Minimum value of instances in autoscaling group underlying the connector. Value must be between 2 and 9, inclusive. Must be
 * lower than the value specified by max_instances.
 * @property minThroughput Minimum throughput of the connector in Mbps. Default and min is 200. Refers to the expected throughput when using an e2-micro machine type.
 * Value must be a multiple of 100 from 200 through 900. Must be lower than the value specified by max_throughput.
 * Only one of `min_throughput` and `min_instances` can be specified. The use of min_throughput is discouraged in favor of min_instances.
 * @property name The name of the resource (Max 25 characters).
 * - - -
 * @property network Name or self_link of the VPC network. Required if `ip_cidr_range` is set.
 * @property project The ID of the project in which the resource belongs.
 * If it is not provided, the provider project is used.
 * @property region Region where the VPC Access connector resides. If it is not provided, the provider region is used.
 * @property subnet The subnet in which to house the connector
 * Structure is documented below.
 */
public data class ConnectorArgs(
    public val ipCidrRange: Output? = null,
    public val machineType: Output? = null,
    public val maxInstances: Output? = null,
    public val maxThroughput: Output? = null,
    public val minInstances: Output? = null,
    public val minThroughput: Output? = null,
    public val name: Output? = null,
    public val network: Output? = null,
    public val project: Output? = null,
    public val region: Output? = null,
    public val subnet: Output? = null,
) : ConvertibleToJava {
    override fun toJava(): com.pulumi.gcp.vpcaccess.ConnectorArgs =
        com.pulumi.gcp.vpcaccess.ConnectorArgs.builder()
            .ipCidrRange(ipCidrRange?.applyValue({ args0 -> args0 }))
            .machineType(machineType?.applyValue({ args0 -> args0 }))
            .maxInstances(maxInstances?.applyValue({ args0 -> args0 }))
            .maxThroughput(maxThroughput?.applyValue({ args0 -> args0 }))
            .minInstances(minInstances?.applyValue({ args0 -> args0 }))
            .minThroughput(minThroughput?.applyValue({ args0 -> args0 }))
            .name(name?.applyValue({ args0 -> args0 }))
            .network(network?.applyValue({ args0 -> args0 }))
            .project(project?.applyValue({ args0 -> args0 }))
            .region(region?.applyValue({ args0 -> args0 }))
            .subnet(subnet?.applyValue({ args0 -> args0.let({ args0 -> args0.toJava() }) })).build()
}

/**
 * Builder for [ConnectorArgs].
 */
@PulumiTagMarker
public class ConnectorArgsBuilder internal constructor() {
    private var ipCidrRange: Output? = null

    private var machineType: Output? = null

    private var maxInstances: Output? = null

    private var maxThroughput: Output? = null

    private var minInstances: Output? = null

    private var minThroughput: Output? = null

    private var name: Output? = null

    private var network: Output? = null

    private var project: Output? = null

    private var region: Output? = null

    private var subnet: Output? = null

    /**
     * @param value The range of internal addresses that follows RFC 4632 notation. Example: `10.132.0.0/28`.
     */
    @JvmName("sgqellkdxenblisy")
    public suspend fun ipCidrRange(`value`: Output) {
        this.ipCidrRange = value
    }

    /**
     * @param value Machine type of VM Instance underlying connector. Default is e2-micro
     */
    @JvmName("iguawxtxehcqsajs")
    public suspend fun machineType(`value`: Output) {
        this.machineType = value
    }

    /**
     * @param value Maximum value of instances in autoscaling group underlying the connector. Value must be between 3 and 10, inclusive. Must be
     * higher than the value specified by min_instances.
     */
    @JvmName("wjeudvybkfeyohod")
    public suspend fun maxInstances(`value`: Output) {
        this.maxInstances = value
    }

    /**
     * @param value Maximum throughput of the connector in Mbps, must be greater than `min_throughput`. Default is 300. Refers to the expected throughput
     * when using an e2-micro machine type. Value must be a multiple of 100 from 300 through 1000. Must be higher than the value specified by
     * min_throughput. Only one of `max_throughput` and `max_instances` can be specified. The use of max_throughput is discouraged in favor of max_instances.
     */
    @JvmName("rxcruxokiylefiyn")
    public suspend fun maxThroughput(`value`: Output) {
        this.maxThroughput = value
    }

    /**
     * @param value Minimum value of instances in autoscaling group underlying the connector. Value must be between 2 and 9, inclusive. Must be
     * lower than the value specified by max_instances.
     */
    @JvmName("tarxlwidrgfuflqv")
    public suspend fun minInstances(`value`: Output) {
        this.minInstances = value
    }

    /**
     * @param value Minimum throughput of the connector in Mbps. Default and min is 200. Refers to the expected throughput when using an e2-micro machine type.
     * Value must be a multiple of 100 from 200 through 900. Must be lower than the value specified by max_throughput.
     * Only one of `min_throughput` and `min_instances` can be specified. The use of min_throughput is discouraged in favor of min_instances.
     */
    @JvmName("nbgpgrjjmcrjpyot")
    public suspend fun minThroughput(`value`: Output) {
        this.minThroughput = value
    }

    /**
     * @param value The name of the resource (Max 25 characters).
     * - - -
     */
    @JvmName("vdyiasyriybqspni")
    public suspend fun name(`value`: Output) {
        this.name = value
    }

    /**
     * @param value Name or self_link of the VPC network. Required if `ip_cidr_range` is set.
     */
    @JvmName("jiunaylbwprhfrdp")
    public suspend fun network(`value`: Output) {
        this.network = value
    }

    /**
     * @param value The ID of the project in which the resource belongs.
     * If it is not provided, the provider project is used.
     */
    @JvmName("lujrwctuydnlvnjx")
    public suspend fun project(`value`: Output) {
        this.project = value
    }

    /**
     * @param value Region where the VPC Access connector resides. If it is not provided, the provider region is used.
     */
    @JvmName("ldgxxddoidyyejvp")
    public suspend fun region(`value`: Output) {
        this.region = value
    }

    /**
     * @param value The subnet in which to house the connector
     * Structure is documented below.
     */
    @JvmName("klgnfbisletjexcr")
    public suspend fun subnet(`value`: Output) {
        this.subnet = value
    }

    /**
     * @param value The range of internal addresses that follows RFC 4632 notation. Example: `10.132.0.0/28`.
     */
    @JvmName("cuhmhurefjvtnryr")
    public suspend fun ipCidrRange(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.ipCidrRange = mapped
    }

    /**
     * @param value Machine type of VM Instance underlying connector. Default is e2-micro
     */
    @JvmName("qyjrfdfgrflskkvx")
    public suspend fun machineType(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.machineType = mapped
    }

    /**
     * @param value Maximum value of instances in autoscaling group underlying the connector. Value must be between 3 and 10, inclusive. Must be
     * higher than the value specified by min_instances.
     */
    @JvmName("mifcmbdqkdbthrjd")
    public suspend fun maxInstances(`value`: Int?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.maxInstances = mapped
    }

    /**
     * @param value Maximum throughput of the connector in Mbps, must be greater than `min_throughput`. Default is 300. Refers to the expected throughput
     * when using an e2-micro machine type. Value must be a multiple of 100 from 300 through 1000. Must be higher than the value specified by
     * min_throughput. Only one of `max_throughput` and `max_instances` can be specified. The use of max_throughput is discouraged in favor of max_instances.
     */
    @JvmName("mmokxaapvkullbcy")
    public suspend fun maxThroughput(`value`: Int?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.maxThroughput = mapped
    }

    /**
     * @param value Minimum value of instances in autoscaling group underlying the connector. Value must be between 2 and 9, inclusive. Must be
     * lower than the value specified by max_instances.
     */
    @JvmName("rrfkdgbstkqmygec")
    public suspend fun minInstances(`value`: Int?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.minInstances = mapped
    }

    /**
     * @param value Minimum throughput of the connector in Mbps. Default and min is 200. Refers to the expected throughput when using an e2-micro machine type.
     * Value must be a multiple of 100 from 200 through 900. Must be lower than the value specified by max_throughput.
     * Only one of `min_throughput` and `min_instances` can be specified. The use of min_throughput is discouraged in favor of min_instances.
     */
    @JvmName("pwwuyhiwuogjbgkk")
    public suspend fun minThroughput(`value`: Int?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.minThroughput = mapped
    }

    /**
     * @param value The name of the resource (Max 25 characters).
     * - - -
     */
    @JvmName("gxigdctwslpfubpq")
    public suspend fun name(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.name = mapped
    }

    /**
     * @param value Name or self_link of the VPC network. Required if `ip_cidr_range` is set.
     */
    @JvmName("teppurkphlfuicpn")
    public suspend fun network(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.network = mapped
    }

    /**
     * @param value The ID of the project in which the resource belongs.
     * If it is not provided, the provider project is used.
     */
    @JvmName("rxagkaivcwfyfnbg")
    public suspend fun project(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.project = mapped
    }

    /**
     * @param value Region where the VPC Access connector resides. If it is not provided, the provider region is used.
     */
    @JvmName("pyrhfmdpsggmlect")
    public suspend fun region(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.region = mapped
    }

    /**
     * @param value The subnet in which to house the connector
     * Structure is documented below.
     */
    @JvmName("kwwmrosuchktirwy")
    public suspend fun subnet(`value`: ConnectorSubnetArgs?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.subnet = mapped
    }

    /**
     * @param argument The subnet in which to house the connector
     * Structure is documented below.
     */
    @JvmName("ymhvfpohwulthsrx")
    public suspend fun subnet(argument: suspend ConnectorSubnetArgsBuilder.() -> Unit) {
        val toBeMapped = ConnectorSubnetArgsBuilder().applySuspend { argument() }.build()
        val mapped = of(toBeMapped)
        this.subnet = mapped
    }

    internal fun build(): ConnectorArgs = ConnectorArgs(
        ipCidrRange = ipCidrRange,
        machineType = machineType,
        maxInstances = maxInstances,
        maxThroughput = maxThroughput,
        minInstances = minInstances,
        minThroughput = minThroughput,
        name = name,
        network = network,
        project = project,
        region = region,
        subnet = subnet,
    )
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy