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

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

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

package com.pulumi.gcp.vpcaccess.kotlin

import com.pulumi.gcp.vpcaccess.VpcaccessFunctions.getConnectorPlain
import com.pulumi.gcp.vpcaccess.kotlin.inputs.GetConnectorPlainArgs
import com.pulumi.gcp.vpcaccess.kotlin.inputs.GetConnectorPlainArgsBuilder
import com.pulumi.gcp.vpcaccess.kotlin.outputs.GetConnectorResult
import com.pulumi.gcp.vpcaccess.kotlin.outputs.GetConnectorResult.Companion.toKotlin
import kotlinx.coroutines.future.await
import kotlin.String
import kotlin.Suppress
import kotlin.Unit

public object VpcaccessFunctions {
    /**
     * Get a Serverless VPC Access connector.
     * 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
     * 
     * ```typescript
     * import * as pulumi from "@pulumi/pulumi";
     * import * as gcp from "@pulumi/gcp";
     * const sample = gcp.vpcaccess.getConnector({
     *     name: "vpc-con",
     * });
     * const connector = new gcp.vpcaccess.Connector("connector", {
     *     name: "vpc-con",
     *     ipCidrRange: "10.8.0.0/28",
     *     network: "default",
     *     region: "us-central1",
     * });
     * ```
     * ```python
     * import pulumi
     * import pulumi_gcp as gcp
     * sample = gcp.vpcaccess.get_connector(name="vpc-con")
     * connector = gcp.vpcaccess.Connector("connector",
     *     name="vpc-con",
     *     ip_cidr_range="10.8.0.0/28",
     *     network="default",
     *     region="us-central1")
     * ```
     * ```csharp
     * using System.Collections.Generic;
     * using System.Linq;
     * using Pulumi;
     * using Gcp = Pulumi.Gcp;
     * return await Deployment.RunAsync(() =>
     * {
     *     var sample = Gcp.VpcAccess.GetConnector.Invoke(new()
     *     {
     *         Name = "vpc-con",
     *     });
     *     var connector = new Gcp.VpcAccess.Connector("connector", new()
     *     {
     *         Name = "vpc-con",
     *         IpCidrRange = "10.8.0.0/28",
     *         Network = "default",
     *         Region = "us-central1",
     *     });
     * });
     * ```
     * ```go
     * package main
     * import (
     * 	"github.com/pulumi/pulumi-gcp/sdk/v7/go/gcp/vpcaccess"
     * 	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
     * )
     * func main() {
     * 	pulumi.Run(func(ctx *pulumi.Context) error {
     * 		_, err := vpcaccess.LookupConnector(ctx, &vpcaccess.LookupConnectorArgs{
     * 			Name: "vpc-con",
     * 		}, nil)
     * 		if err != nil {
     * 			return err
     * 		}
     * 		_, err = vpcaccess.NewConnector(ctx, "connector", &vpcaccess.ConnectorArgs{
     * 			Name:        pulumi.String("vpc-con"),
     * 			IpCidrRange: pulumi.String("10.8.0.0/28"),
     * 			Network:     pulumi.String("default"),
     * 			Region:      pulumi.String("us-central1"),
     * 		})
     * 		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.VpcaccessFunctions;
     * import com.pulumi.gcp.vpcaccess.inputs.GetConnectorArgs;
     * 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) {
     *         final var sample = VpcaccessFunctions.getConnector(GetConnectorArgs.builder()
     *             .name("vpc-con")
     *             .build());
     *         var connector = new Connector("connector", ConnectorArgs.builder()
     *             .name("vpc-con")
     *             .ipCidrRange("10.8.0.0/28")
     *             .network("default")
     *             .region("us-central1")
     *             .build());
     *     }
     * }
     * ```
     * ```yaml
     * resources:
     *   connector:
     *     type: gcp:vpcaccess:Connector
     *     properties:
     *       name: vpc-con
     *       ipCidrRange: 10.8.0.0/28
     *       network: default
     *       region: us-central1
     * variables:
     *   sample:
     *     fn::invoke:
     *       Function: gcp:vpcaccess:getConnector
     *       Arguments:
     *         name: vpc-con
     * ```
     * 
     * @param argument A collection of arguments for invoking getConnector.
     * @return A collection of values returned by getConnector.
     */
    public suspend fun getConnector(argument: GetConnectorPlainArgs): GetConnectorResult =
        toKotlin(getConnectorPlain(argument.toJava()).await())

    /**
     * @see [getConnector].
     * @param name Name of the resource.
     * - - -
     * @param project The ID of the project in which the resource belongs. If it
     * is not provided, the provider project is used.
     * @param region The region in which the resource belongs. If it
     * is not provided, the provider region is used.
     * @return A collection of values returned by getConnector.
     */
    public suspend fun getConnector(
        name: String,
        project: String? = null,
        region: String? = null,
    ): GetConnectorResult {
        val argument = GetConnectorPlainArgs(
            name = name,
            project = project,
            region = region,
        )
        return toKotlin(getConnectorPlain(argument.toJava()).await())
    }

    /**
     * @see [getConnector].
     * @param argument Builder for [com.pulumi.gcp.vpcaccess.kotlin.inputs.GetConnectorPlainArgs].
     * @return A collection of values returned by getConnector.
     */
    public suspend fun getConnector(argument: suspend GetConnectorPlainArgsBuilder.() -> Unit): GetConnectorResult {
        val builder = GetConnectorPlainArgsBuilder()
        builder.argument()
        val builtArgument = builder.build()
        return toKotlin(getConnectorPlain(builtArgument.toJava()).await())
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy