com.pulumi.gcp.gkehub.kotlin.Namespace.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of pulumi-gcp-kotlin Show documentation
Show all versions of pulumi-gcp-kotlin Show documentation
Build cloud applications and infrastructure by combining the safety and reliability of infrastructure as code with the power of the Kotlin programming language.
@file:Suppress("NAME_SHADOWING", "DEPRECATION")
package com.pulumi.gcp.gkehub.kotlin
import com.pulumi.core.Output
import com.pulumi.gcp.gkehub.kotlin.outputs.NamespaceState
import com.pulumi.gcp.gkehub.kotlin.outputs.NamespaceState.Companion.toKotlin
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
import kotlin.collections.Map
/**
* Builder for [Namespace].
*/
@PulumiTagMarker
public class NamespaceResourceBuilder internal constructor() {
public var name: String? = null
public var args: NamespaceArgs = NamespaceArgs()
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 NamespaceArgsBuilder.() -> Unit) {
val builder = NamespaceArgsBuilder()
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(): Namespace {
val builtJavaResource = com.pulumi.gcp.gkehub.Namespace(
this.name,
this.args.toJava(),
this.opts.toJava(),
)
return Namespace(builtJavaResource)
}
}
/**
* 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}}
* ```
*/
public class Namespace internal constructor(
override val javaResource: com.pulumi.gcp.gkehub.Namespace,
) : KotlinCustomResource(javaResource, NamespaceMapper) {
/**
* Time the Namespace was created in UTC.
*/
public val createTime: Output
get() = javaResource.createTime().applyValue({ args0 -> args0 })
/**
* Time the Namespace was deleted in UTC.
*/
public val deleteTime: Output
get() = javaResource.deleteTime().applyValue({ args0 -> args0 })
/**
* All of labels (key/value pairs) present on the resource in GCP, including the labels configured through Pulumi, other clients and services.
*/
public val effectiveLabels: Output
© 2015 - 2024 Weber Informatics LLC | Privacy Policy