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

com.pulumi.gcp.iap.kotlin.TunnelDestGroup.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.iap.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
import kotlin.collections.List

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

    public var args: TunnelDestGroupArgs = TunnelDestGroupArgs()

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

/**
 * Tunnel destination groups represent resources that have the same tunnel access restrictions.
 * To get more information about TunnelDestGroup, see:
 * * [API documentation](https://cloud.google.com/iap/docs/reference/rest/v1/projects.iap_tunnel.locations.destGroups)
 * * How-to Guides
 *     * [Set up IAP TCP forwarding with an IP address or hostname in a Google Cloud or non-Google Cloud environment](https://cloud.google.com/iap/docs/tcp-by-host)
 * ## Example Usage
 * ### Iap Destgroup
 * 
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as gcp from "@pulumi/gcp";
 * const destGroup = new gcp.iap.TunnelDestGroup("dest_group", {
 *     region: "us-central1",
 *     groupName: "testgroup_75092",
 *     cidrs: [
 *         "10.1.0.0/16",
 *         "192.168.10.0/24",
 *     ],
 * });
 * ```
 * ```python
 * import pulumi
 * import pulumi_gcp as gcp
 * dest_group = gcp.iap.TunnelDestGroup("dest_group",
 *     region="us-central1",
 *     group_name="testgroup_75092",
 *     cidrs=[
 *         "10.1.0.0/16",
 *         "192.168.10.0/24",
 *     ])
 * ```
 * ```csharp
 * using System.Collections.Generic;
 * using System.Linq;
 * using Pulumi;
 * using Gcp = Pulumi.Gcp;
 * return await Deployment.RunAsync(() =>
 * {
 *     var destGroup = new Gcp.Iap.TunnelDestGroup("dest_group", new()
 *     {
 *         Region = "us-central1",
 *         GroupName = "testgroup_75092",
 *         Cidrs = new[]
 *         {
 *             "10.1.0.0/16",
 *             "192.168.10.0/24",
 *         },
 *     });
 * });
 * ```
 * ```go
 * package main
 * import (
 * 	"github.com/pulumi/pulumi-gcp/sdk/v7/go/gcp/iap"
 * 	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
 * )
 * func main() {
 * 	pulumi.Run(func(ctx *pulumi.Context) error {
 * 		_, err := iap.NewTunnelDestGroup(ctx, "dest_group", &iap.TunnelDestGroupArgs{
 * 			Region:    pulumi.String("us-central1"),
 * 			GroupName: pulumi.String("testgroup_75092"),
 * 			Cidrs: pulumi.StringArray{
 * 				pulumi.String("10.1.0.0/16"),
 * 				pulumi.String("192.168.10.0/24"),
 * 			},
 * 		})
 * 		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.iap.TunnelDestGroup;
 * import com.pulumi.gcp.iap.TunnelDestGroupArgs;
 * 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 destGroup = new TunnelDestGroup("destGroup", TunnelDestGroupArgs.builder()
 *             .region("us-central1")
 *             .groupName("testgroup_75092")
 *             .cidrs(
 *                 "10.1.0.0/16",
 *                 "192.168.10.0/24")
 *             .build());
 *     }
 * }
 * ```
 * ```yaml
 * resources:
 *   destGroup:
 *     type: gcp:iap:TunnelDestGroup
 *     name: dest_group
 *     properties:
 *       region: us-central1
 *       groupName: testgroup_75092
 *       cidrs:
 *         - 10.1.0.0/16
 *         - 192.168.10.0/24
 * ```
 * 
 * ## Import
 * TunnelDestGroup can be imported using any of these accepted formats:
 * * `projects/{{project}}/iap_tunnel/locations/{{region}}/destGroups/{{group_name}}`
 * * `{{project}}/iap_tunnel/locations/{{region}}/destGroups/{{group_name}}`
 * * `{{project}}/{{region}}/{{group_name}}`
 * * `{{region}}/destGroups/{{group_name}}`
 * * `{{region}}/{{group_name}}`
 * * `{{group_name}}`
 * When using the `pulumi import` command, TunnelDestGroup can be imported using one of the formats above. For example:
 * ```sh
 * $ pulumi import gcp:iap/tunnelDestGroup:TunnelDestGroup default projects/{{project}}/iap_tunnel/locations/{{region}}/destGroups/{{group_name}}
 * ```
 * ```sh
 * $ pulumi import gcp:iap/tunnelDestGroup:TunnelDestGroup default {{project}}/iap_tunnel/locations/{{region}}/destGroups/{{group_name}}
 * ```
 * ```sh
 * $ pulumi import gcp:iap/tunnelDestGroup:TunnelDestGroup default {{project}}/{{region}}/{{group_name}}
 * ```
 * ```sh
 * $ pulumi import gcp:iap/tunnelDestGroup:TunnelDestGroup default {{region}}/destGroups/{{group_name}}
 * ```
 * ```sh
 * $ pulumi import gcp:iap/tunnelDestGroup:TunnelDestGroup default {{region}}/{{group_name}}
 * ```
 * ```sh
 * $ pulumi import gcp:iap/tunnelDestGroup:TunnelDestGroup default {{group_name}}
 * ```
 */
public class TunnelDestGroup internal constructor(
    override val javaResource: com.pulumi.gcp.iap.TunnelDestGroup,
) : KotlinCustomResource(javaResource, TunnelDestGroupMapper) {
    /**
     * List of CIDRs that this group applies to.
     */
    public val cidrs: Output>?
        get() = javaResource.cidrs().applyValue({ args0 ->
            args0.map({ args0 ->
                args0.map({ args0 ->
                    args0
                })
            }).orElse(null)
        })

    /**
     * List of FQDNs that this group applies to.
     */
    public val fqdns: Output>?
        get() = javaResource.fqdns().applyValue({ args0 ->
            args0.map({ args0 ->
                args0.map({ args0 ->
                    args0
                })
            }).orElse(null)
        })

    /**
     * Unique tunnel destination group name.
     * - - -
     */
    public val groupName: Output
        get() = javaResource.groupName().applyValue({ args0 -> args0 })

    /**
     * Full resource name.
     */
    public val name: Output
        get() = javaResource.name().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 })

    /**
     * The region of the tunnel group. Must be the same as the network resources in the group.
     */
    public val region: Output
        get() = javaResource.region().applyValue({ args0 -> args0 })
}

public object TunnelDestGroupMapper : ResourceMapper {
    override fun supportsMappingOfType(javaResource: Resource): Boolean =
        com.pulumi.gcp.iap.TunnelDestGroup::class == javaResource::class

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

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

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




© 2015 - 2024 Weber Informatics LLC | Privacy Policy