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

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

package com.pulumi.gcp.gkehub.kotlin

import com.pulumi.core.Output
import com.pulumi.core.Output.of
import com.pulumi.gcp.gkehub.NamespaceArgs.builder
import com.pulumi.kotlin.ConvertibleToJava
import com.pulumi.kotlin.PulumiTagMarker
import kotlin.Pair
import kotlin.String
import kotlin.Suppress
import kotlin.collections.Map
import kotlin.jvm.JvmName

/**
 * Namespace represents a namespace across the Fleet.
 * To get more information about Namespace, see:
 * * [API documentation](https://cloud.google.com/anthos/fleet-management/docs/reference/rest/v1/projects.locations.scopes.namespaces)
 * * How-to Guides
 *     * [Registering a Cluster](https://cloud.google.com/anthos/multicluster-management/connect/registering-a-cluster#register_cluster)
 * ## Example Usage
 * ### Gkehub Namespace Basic
 * 
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as gcp from "@pulumi/gcp";
 * const scope = new gcp.gkehub.Scope("scope", {scopeId: "tf-test-scope_9106"});
 * const namespace = new gcp.gkehub.Namespace("namespace", {
 *     scopeNamespaceId: "tf-test-namespace_27169",
 *     scopeId: scope.scopeId,
 *     scope: scope.name,
 *     namespaceLabels: {
 *         keyb: "valueb",
 *         keya: "valuea",
 *         keyc: "valuec",
 *     },
 *     labels: {
 *         keyb: "valueb",
 *         keya: "valuea",
 *         keyc: "valuec",
 *     },
 * });
 * ```
 * ```python
 * import pulumi
 * import pulumi_gcp as gcp
 * scope = gcp.gkehub.Scope("scope", scope_id="tf-test-scope_9106")
 * namespace = gcp.gkehub.Namespace("namespace",
 *     scope_namespace_id="tf-test-namespace_27169",
 *     scope_id=scope.scope_id,
 *     scope=scope.name,
 *     namespace_labels={
 *         "keyb": "valueb",
 *         "keya": "valuea",
 *         "keyc": "valuec",
 *     },
 *     labels={
 *         "keyb": "valueb",
 *         "keya": "valuea",
 *         "keyc": "valuec",
 *     })
 * ```
 * ```csharp
 * using System.Collections.Generic;
 * using System.Linq;
 * using Pulumi;
 * using Gcp = Pulumi.Gcp;
 * return await Deployment.RunAsync(() =>
 * {
 *     var scope = new Gcp.GkeHub.Scope("scope", new()
 *     {
 *         ScopeId = "tf-test-scope_9106",
 *     });
 *     var @namespace = new Gcp.GkeHub.Namespace("namespace", new()
 *     {
 *         ScopeNamespaceId = "tf-test-namespace_27169",
 *         ScopeId = scope.ScopeId,
 *         Scope = scope.Name,
 *         NamespaceLabels =
 *         {
 *             { "keyb", "valueb" },
 *             { "keya", "valuea" },
 *             { "keyc", "valuec" },
 *         },
 *         Labels =
 *         {
 *             { "keyb", "valueb" },
 *             { "keya", "valuea" },
 *             { "keyc", "valuec" },
 *         },
 *     });
 * });
 * ```
 * ```go
 * package main
 * import (
 * 	"github.com/pulumi/pulumi-gcp/sdk/v7/go/gcp/gkehub"
 * 	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
 * )
 * func main() {
 * 	pulumi.Run(func(ctx *pulumi.Context) error {
 * 		scope, err := gkehub.NewScope(ctx, "scope", &gkehub.ScopeArgs{
 * 			ScopeId: pulumi.String("tf-test-scope_9106"),
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		_, err = gkehub.NewNamespace(ctx, "namespace", &gkehub.NamespaceArgs{
 * 			ScopeNamespaceId: pulumi.String("tf-test-namespace_27169"),
 * 			ScopeId:          scope.ScopeId,
 * 			Scope:            scope.Name,
 * 			NamespaceLabels: pulumi.StringMap{
 * 				"keyb": pulumi.String("valueb"),
 * 				"keya": pulumi.String("valuea"),
 * 				"keyc": pulumi.String("valuec"),
 * 			},
 * 			Labels: pulumi.StringMap{
 * 				"keyb": pulumi.String("valueb"),
 * 				"keya": pulumi.String("valuea"),
 * 				"keyc": pulumi.String("valuec"),
 * 			},
 * 		})
 * 		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.gkehub.Scope;
 * import com.pulumi.gcp.gkehub.ScopeArgs;
 * import com.pulumi.gcp.gkehub.Namespace;
 * import com.pulumi.gcp.gkehub.NamespaceArgs;
 * 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 scope = new Scope("scope", ScopeArgs.builder()
 *             .scopeId("tf-test-scope_9106")
 *             .build());
 *         var namespace = new Namespace("namespace", NamespaceArgs.builder()
 *             .scopeNamespaceId("tf-test-namespace_27169")
 *             .scopeId(scope.scopeId())
 *             .scope(scope.name())
 *             .namespaceLabels(Map.ofEntries(
 *                 Map.entry("keyb", "valueb"),
 *                 Map.entry("keya", "valuea"),
 *                 Map.entry("keyc", "valuec")
 *             ))
 *             .labels(Map.ofEntries(
 *                 Map.entry("keyb", "valueb"),
 *                 Map.entry("keya", "valuea"),
 *                 Map.entry("keyc", "valuec")
 *             ))
 *             .build());
 *     }
 * }
 * ```
 * ```yaml
 * resources:
 *   scope:
 *     type: gcp:gkehub:Scope
 *     properties:
 *       scopeId: tf-test-scope_9106
 *   namespace:
 *     type: gcp:gkehub:Namespace
 *     properties:
 *       scopeNamespaceId: tf-test-namespace_27169
 *       scopeId: ${scope.scopeId}
 *       scope: ${scope.name}
 *       namespaceLabels:
 *         keyb: valueb
 *         keya: valuea
 *         keyc: valuec
 *       labels:
 *         keyb: valueb
 *         keya: valuea
 *         keyc: valuec
 * ```
 * 
 * ## Import
 * Namespace can be imported using any of these accepted formats:
 * * `projects/{{project}}/locations/global/scopes/{{scope_id}}/namespaces/{{scope_namespace_id}}`
 * * `{{project}}/{{scope_id}}/{{scope_namespace_id}}`
 * * `{{scope_id}}/{{scope_namespace_id}}`
 * When using the `pulumi import` command, Namespace can be imported using one of the formats above. For example:
 * ```sh
 * $ pulumi import gcp:gkehub/namespace:Namespace default projects/{{project}}/locations/global/scopes/{{scope_id}}/namespaces/{{scope_namespace_id}}
 * ```
 * ```sh
 * $ pulumi import gcp:gkehub/namespace:Namespace default {{project}}/{{scope_id}}/{{scope_namespace_id}}
 * ```
 * ```sh
 * $ pulumi import gcp:gkehub/namespace:Namespace default {{scope_id}}/{{scope_namespace_id}}
 * ```
 * @property labels Labels for this Namespace.
 * **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 namespaceLabels Namespace-level cluster namespace labels. These labels are applied
 * to the related namespace of the member clusters bound to the parent
 * Scope. Scope-level labels (`namespace_labels` in the Fleet Scope
 * resource) take precedence over Namespace-level labels if they share
 * a key. Keys and values must be Kubernetes-conformant.
 * @property project The ID of the project in which the resource belongs.
 * If it is not provided, the provider project is used.
 * @property scope The name of the Scope instance.
 * @property scopeId Id of the scope
 * - - -
 * @property scopeNamespaceId The client-provided identifier of the namespace.
 */
public data class NamespaceArgs(
    public val labels: Output>? = null,
    public val namespaceLabels: Output>? = null,
    public val project: Output? = null,
    public val scope: Output? = null,
    public val scopeId: Output? = null,
    public val scopeNamespaceId: Output? = null,
) : ConvertibleToJava {
    override fun toJava(): com.pulumi.gcp.gkehub.NamespaceArgs =
        com.pulumi.gcp.gkehub.NamespaceArgs.builder()
            .labels(labels?.applyValue({ args0 -> args0.map({ args0 -> args0.key.to(args0.value) }).toMap() }))
            .namespaceLabels(
                namespaceLabels?.applyValue({ args0 ->
                    args0.map({ args0 ->
                        args0.key.to(args0.value)
                    }).toMap()
                }),
            )
            .project(project?.applyValue({ args0 -> args0 }))
            .scope(scope?.applyValue({ args0 -> args0 }))
            .scopeId(scopeId?.applyValue({ args0 -> args0 }))
            .scopeNamespaceId(scopeNamespaceId?.applyValue({ args0 -> args0 })).build()
}

/**
 * Builder for [NamespaceArgs].
 */
@PulumiTagMarker
public class NamespaceArgsBuilder internal constructor() {
    private var labels: Output>? = null

    private var namespaceLabels: Output>? = null

    private var project: Output? = null

    private var scope: Output? = null

    private var scopeId: Output? = null

    private var scopeNamespaceId: Output? = null

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

    /**
     * @param value Namespace-level cluster namespace labels. These labels are applied
     * to the related namespace of the member clusters bound to the parent
     * Scope. Scope-level labels (`namespace_labels` in the Fleet Scope
     * resource) take precedence over Namespace-level labels if they share
     * a key. Keys and values must be Kubernetes-conformant.
     */
    @JvmName("tpgfaceqdlngkbnb")
    public suspend fun namespaceLabels(`value`: Output>) {
        this.namespaceLabels = value
    }

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

    /**
     * @param value The name of the Scope instance.
     */
    @JvmName("rpbffylbuhylmupp")
    public suspend fun scope(`value`: Output) {
        this.scope = value
    }

    /**
     * @param value Id of the scope
     * - - -
     */
    @JvmName("yipspdesvnsjvicx")
    public suspend fun scopeId(`value`: Output) {
        this.scopeId = value
    }

    /**
     * @param value The client-provided identifier of the namespace.
     */
    @JvmName("olbvbxedjpcbbtxb")
    public suspend fun scopeNamespaceId(`value`: Output) {
        this.scopeNamespaceId = value
    }

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

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

    /**
     * @param value Namespace-level cluster namespace labels. These labels are applied
     * to the related namespace of the member clusters bound to the parent
     * Scope. Scope-level labels (`namespace_labels` in the Fleet Scope
     * resource) take precedence over Namespace-level labels if they share
     * a key. Keys and values must be Kubernetes-conformant.
     */
    @JvmName("ylgokvvlrefdhlql")
    public suspend fun namespaceLabels(`value`: Map?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.namespaceLabels = mapped
    }

    /**
     * @param values Namespace-level cluster namespace labels. These labels are applied
     * to the related namespace of the member clusters bound to the parent
     * Scope. Scope-level labels (`namespace_labels` in the Fleet Scope
     * resource) take precedence over Namespace-level labels if they share
     * a key. Keys and values must be Kubernetes-conformant.
     */
    @JvmName("iogqlgotphlyjjil")
    public fun namespaceLabels(vararg values: Pair) {
        val toBeMapped = values.toMap()
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.namespaceLabels = mapped
    }

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

    /**
     * @param value The name of the Scope instance.
     */
    @JvmName("wjwmddgcctutqiaq")
    public suspend fun scope(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.scope = mapped
    }

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

    /**
     * @param value The client-provided identifier of the namespace.
     */
    @JvmName("vedwlhnillmeowkw")
    public suspend fun scopeNamespaceId(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.scopeNamespaceId = mapped
    }

    internal fun build(): NamespaceArgs = NamespaceArgs(
        labels = labels,
        namespaceLabels = namespaceLabels,
        project = project,
        scope = scope,
        scopeId = scopeId,
        scopeNamespaceId = scopeNamespaceId,
    )
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy