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

com.pulumi.gcp.networkconnectivity.kotlin.GroupArgs.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.20.1.0
Show newest version
@file:Suppress("NAME_SHADOWING", "DEPRECATION")

package com.pulumi.gcp.networkconnectivity.kotlin

import com.pulumi.core.Output
import com.pulumi.core.Output.of
import com.pulumi.gcp.networkconnectivity.GroupArgs.builder
import com.pulumi.gcp.networkconnectivity.kotlin.inputs.GroupAutoAcceptArgs
import com.pulumi.gcp.networkconnectivity.kotlin.inputs.GroupAutoAcceptArgsBuilder
import com.pulumi.kotlin.ConvertibleToJava
import com.pulumi.kotlin.PulumiTagMarker
import com.pulumi.kotlin.applySuspend
import kotlin.Pair
import kotlin.String
import kotlin.Suppress
import kotlin.Unit
import kotlin.collections.Map
import kotlin.jvm.JvmName

/**
 * The NetworkConnectivity Group resource
 * To get more information about Group, see:
 * * [API documentation](https://cloud.google.com/network-connectivity/docs/reference/networkconnectivity/rest/v1beta/projects.locations.global.hubs.groups)
 * * How-to Guides
 *     * [Official Documentation](https://cloud.google.com/network-connectivity/docs/network-connectivity-center/concepts/overview)
 * ## Example Usage
 * ### Network Connectivity Group Basic
 * 
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as gcp from "@pulumi/gcp";
 * const basicHub = new gcp.networkconnectivity.Hub("basic_hub", {
 *     name: "network-connectivity-hub1",
 *     description: "A sample hub",
 *     labels: {
 *         "label-one": "value-one",
 *     },
 * });
 * const primary = new gcp.networkconnectivity.Group("primary", {
 *     hub: basicHub.id,
 *     name: "default",
 *     labels: {
 *         "label-one": "value-one",
 *     },
 *     description: "A sample hub group",
 *     autoAccept: {
 *         autoAcceptProjects: [
 *             "foo",
 *             "bar",
 *         ],
 *     },
 * });
 * ```
 * ```python
 * import pulumi
 * import pulumi_gcp as gcp
 * basic_hub = gcp.networkconnectivity.Hub("basic_hub",
 *     name="network-connectivity-hub1",
 *     description="A sample hub",
 *     labels={
 *         "label-one": "value-one",
 *     })
 * primary = gcp.networkconnectivity.Group("primary",
 *     hub=basic_hub.id,
 *     name="default",
 *     labels={
 *         "label-one": "value-one",
 *     },
 *     description="A sample hub group",
 *     auto_accept={
 *         "auto_accept_projects": [
 *             "foo",
 *             "bar",
 *         ],
 *     })
 * ```
 * ```csharp
 * using System.Collections.Generic;
 * using System.Linq;
 * using Pulumi;
 * using Gcp = Pulumi.Gcp;
 * return await Deployment.RunAsync(() =>
 * {
 *     var basicHub = new Gcp.NetworkConnectivity.Hub("basic_hub", new()
 *     {
 *         Name = "network-connectivity-hub1",
 *         Description = "A sample hub",
 *         Labels =
 *         {
 *             { "label-one", "value-one" },
 *         },
 *     });
 *     var primary = new Gcp.NetworkConnectivity.Group("primary", new()
 *     {
 *         Hub = basicHub.Id,
 *         Name = "default",
 *         Labels =
 *         {
 *             { "label-one", "value-one" },
 *         },
 *         Description = "A sample hub group",
 *         AutoAccept = new Gcp.NetworkConnectivity.Inputs.GroupAutoAcceptArgs
 *         {
 *             AutoAcceptProjects = new[]
 *             {
 *                 "foo",
 *                 "bar",
 *             },
 *         },
 *     });
 * });
 * ```
 * ```go
 * package main
 * import (
 * 	"github.com/pulumi/pulumi-gcp/sdk/v8/go/gcp/networkconnectivity"
 * 	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
 * )
 * func main() {
 * 	pulumi.Run(func(ctx *pulumi.Context) error {
 * 		basicHub, err := networkconnectivity.NewHub(ctx, "basic_hub", &networkconnectivity.HubArgs{
 * 			Name:        pulumi.String("network-connectivity-hub1"),
 * 			Description: pulumi.String("A sample hub"),
 * 			Labels: pulumi.StringMap{
 * 				"label-one": pulumi.String("value-one"),
 * 			},
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		_, err = networkconnectivity.NewGroup(ctx, "primary", &networkconnectivity.GroupArgs{
 * 			Hub:  basicHub.ID(),
 * 			Name: pulumi.String("default"),
 * 			Labels: pulumi.StringMap{
 * 				"label-one": pulumi.String("value-one"),
 * 			},
 * 			Description: pulumi.String("A sample hub group"),
 * 			AutoAccept: &networkconnectivity.GroupAutoAcceptArgs{
 * 				AutoAcceptProjects: pulumi.StringArray{
 * 					pulumi.String("foo"),
 * 					pulumi.String("bar"),
 * 				},
 * 			},
 * 		})
 * 		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.networkconnectivity.Hub;
 * import com.pulumi.gcp.networkconnectivity.HubArgs;
 * import com.pulumi.gcp.networkconnectivity.Group;
 * import com.pulumi.gcp.networkconnectivity.GroupArgs;
 * import com.pulumi.gcp.networkconnectivity.inputs.GroupAutoAcceptArgs;
 * 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 basicHub = new Hub("basicHub", HubArgs.builder()
 *             .name("network-connectivity-hub1")
 *             .description("A sample hub")
 *             .labels(Map.of("label-one", "value-one"))
 *             .build());
 *         var primary = new Group("primary", GroupArgs.builder()
 *             .hub(basicHub.id())
 *             .name("default")
 *             .labels(Map.of("label-one", "value-one"))
 *             .description("A sample hub group")
 *             .autoAccept(GroupAutoAcceptArgs.builder()
 *                 .autoAcceptProjects(
 *                     "foo",
 *                     "bar")
 *                 .build())
 *             .build());
 *     }
 * }
 * ```
 * ```yaml
 * resources:
 *   basicHub:
 *     type: gcp:networkconnectivity:Hub
 *     name: basic_hub
 *     properties:
 *       name: network-connectivity-hub1
 *       description: A sample hub
 *       labels:
 *         label-one: value-one
 *   primary:
 *     type: gcp:networkconnectivity:Group
 *     properties:
 *       hub: ${basicHub.id}
 *       name: default
 *       labels:
 *         label-one: value-one
 *       description: A sample hub group
 *       autoAccept:
 *         autoAcceptProjects:
 *           - foo
 *           - bar
 * ```
 * 
 * ## Import
 * Group can be imported using any of these accepted formats:
 * * `projects/{{project}}/locations/global/hubs/{{hub}}/groups/{{name}}`
 * * `{{project}}/{{hub}}/{{name}}`
 * * `{{hub}}/{{name}}`
 * When using the `pulumi import` command, Group can be imported using one of the formats above. For example:
 * ```sh
 * $ pulumi import gcp:networkconnectivity/group:Group default projects/{{project}}/locations/global/hubs/{{hub}}/groups/{{name}}
 * ```
 * ```sh
 * $ pulumi import gcp:networkconnectivity/group:Group default {{project}}/{{hub}}/{{name}}
 * ```
 * ```sh
 * $ pulumi import gcp:networkconnectivity/group:Group default {{hub}}/{{name}}
 * ```
 * @property autoAccept Optional. The auto-accept setting for this group.
 * Structure is documented below.
 * @property description An optional description of the group.
 * @property hub The name of the hub. Hub names must be unique. They use the following form: projects/{projectNumber}/locations/global/hubs/{hubId}
 * - - -
 * @property labels Optional labels in key:value format. For more information about labels, see [Requirements for labels](https://cloud.google.com/resource-manager/docs/creating-managing-labels#requirements).
 * **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 name The name of the group. Group names must be unique.
 * Possible values are: `default`, `center`, `edge`.
 * @property project The ID of the project in which the resource belongs.
 * If it is not provided, the provider project is used.
 */
public data class GroupArgs(
    public val autoAccept: Output? = null,
    public val description: Output? = null,
    public val hub: Output? = null,
    public val labels: Output>? = null,
    public val name: Output? = null,
    public val project: Output? = null,
) : ConvertibleToJava {
    override fun toJava(): com.pulumi.gcp.networkconnectivity.GroupArgs =
        com.pulumi.gcp.networkconnectivity.GroupArgs.builder()
            .autoAccept(autoAccept?.applyValue({ args0 -> args0.let({ args0 -> args0.toJava() }) }))
            .description(description?.applyValue({ args0 -> args0 }))
            .hub(hub?.applyValue({ args0 -> args0 }))
            .labels(labels?.applyValue({ args0 -> args0.map({ args0 -> args0.key.to(args0.value) }).toMap() }))
            .name(name?.applyValue({ args0 -> args0 }))
            .project(project?.applyValue({ args0 -> args0 })).build()
}

/**
 * Builder for [GroupArgs].
 */
@PulumiTagMarker
public class GroupArgsBuilder internal constructor() {
    private var autoAccept: Output? = null

    private var description: Output? = null

    private var hub: Output? = null

    private var labels: Output>? = null

    private var name: Output? = null

    private var project: Output? = null

    /**
     * @param value Optional. The auto-accept setting for this group.
     * Structure is documented below.
     */
    @JvmName("jcqjpugffujhepdb")
    public suspend fun autoAccept(`value`: Output) {
        this.autoAccept = value
    }

    /**
     * @param value An optional description of the group.
     */
    @JvmName("dkexcrkucpktgfar")
    public suspend fun description(`value`: Output) {
        this.description = value
    }

    /**
     * @param value The name of the hub. Hub names must be unique. They use the following form: projects/{projectNumber}/locations/global/hubs/{hubId}
     * - - -
     */
    @JvmName("mumfjpntmwxqiqlo")
    public suspend fun hub(`value`: Output) {
        this.hub = value
    }

    /**
     * @param value Optional labels in key:value format. For more information about labels, see [Requirements for labels](https://cloud.google.com/resource-manager/docs/creating-managing-labels#requirements).
     * **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("hhqqwwsrswdjpknc")
    public suspend fun labels(`value`: Output>) {
        this.labels = value
    }

    /**
     * @param value The name of the group. Group names must be unique.
     * Possible values are: `default`, `center`, `edge`.
     */
    @JvmName("fripmtxfqrsygxvl")
    public suspend fun name(`value`: Output) {
        this.name = value
    }

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

    /**
     * @param value Optional. The auto-accept setting for this group.
     * Structure is documented below.
     */
    @JvmName("rrgqqehpwbnuqjbm")
    public suspend fun autoAccept(`value`: GroupAutoAcceptArgs?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.autoAccept = mapped
    }

    /**
     * @param argument Optional. The auto-accept setting for this group.
     * Structure is documented below.
     */
    @JvmName("fcnlsgbdfaopomdb")
    public suspend fun autoAccept(argument: suspend GroupAutoAcceptArgsBuilder.() -> Unit) {
        val toBeMapped = GroupAutoAcceptArgsBuilder().applySuspend { argument() }.build()
        val mapped = of(toBeMapped)
        this.autoAccept = mapped
    }

    /**
     * @param value An optional description of the group.
     */
    @JvmName("opeyjxhtwyaahguw")
    public suspend fun description(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.description = mapped
    }

    /**
     * @param value The name of the hub. Hub names must be unique. They use the following form: projects/{projectNumber}/locations/global/hubs/{hubId}
     * - - -
     */
    @JvmName("kryslawrrcclvcua")
    public suspend fun hub(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.hub = mapped
    }

    /**
     * @param value Optional labels in key:value format. For more information about labels, see [Requirements for labels](https://cloud.google.com/resource-manager/docs/creating-managing-labels#requirements).
     * **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("kkuduhigoiukidaj")
    public suspend fun labels(`value`: Map?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.labels = mapped
    }

    /**
     * @param values Optional labels in key:value format. For more information about labels, see [Requirements for labels](https://cloud.google.com/resource-manager/docs/creating-managing-labels#requirements).
     * **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("gtxgyihemxuribte")
    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 group. Group names must be unique.
     * Possible values are: `default`, `center`, `edge`.
     */
    @JvmName("iifrhvxipjseojgf")
    public suspend fun name(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.name = mapped
    }

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

    internal fun build(): GroupArgs = GroupArgs(
        autoAccept = autoAccept,
        description = description,
        hub = hub,
        labels = labels,
        name = name,
        project = project,
    )
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy