Namespace

class Namespace : KotlinCustomResource

Namespace represents a namespace across the Fleet. To get more information about Namespace, see:

Example Usage

Gkehub Namespace Basic

import * as pulumi from "@pulumi/pulumi";
import * as gcp from "@pulumi/gcp";
const scope = new gcp.gkehub.Scope("scope", {scopeId: "tf-test-scope_27169"});
const namespace = new gcp.gkehub.Namespace("namespace", {
scopeNamespaceId: "tf-test-namespace_75223",
scopeId: scope.scopeId,
scope: scope.name,
namespaceLabels: {
keyb: "valueb",
keya: "valuea",
keyc: "valuec",
},
labels: {
keyb: "valueb",
keya: "valuea",
keyc: "valuec",
},
}, {
dependsOn: [scope],
});
import pulumi
import pulumi_gcp as gcp
scope = gcp.gkehub.Scope("scope", scope_id="tf-test-scope_27169")
namespace = gcp.gkehub.Namespace("namespace",
scope_namespace_id="tf-test-namespace_75223",
scope_id=scope.scope_id,
scope=scope.name,
namespace_labels={
"keyb": "valueb",
"keya": "valuea",
"keyc": "valuec",
},
labels={
"keyb": "valueb",
"keya": "valuea",
"keyc": "valuec",
},
opts = pulumi.ResourceOptions(depends_on=[scope]))
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_27169",
});
var @namespace = new Gcp.GkeHub.Namespace("namespace", new()
{
ScopeNamespaceId = "tf-test-namespace_75223",
ScopeId = scope.ScopeId,
Scope = scope.Name,
NamespaceLabels =
{
{ "keyb", "valueb" },
{ "keya", "valuea" },
{ "keyc", "valuec" },
},
Labels =
{
{ "keyb", "valueb" },
{ "keya", "valuea" },
{ "keyc", "valuec" },
},
}, new CustomResourceOptions
{
DependsOn =
{
scope,
},
});
});
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_27169"),
})
if err != nil {
return err
}
_, err = gkehub.NewNamespace(ctx, "namespace", &gkehub.NamespaceArgs{
ScopeNamespaceId: pulumi.String("tf-test-namespace_75223"),
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"),
},
}, pulumi.DependsOn([]pulumi.Resource{
scope,
}))
if err != nil {
return err
}
return nil
})
}
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 com.pulumi.resources.CustomResourceOptions;
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_27169")
.build());
var namespace = new Namespace("namespace", NamespaceArgs.builder()
.scopeNamespaceId("tf-test-namespace_75223")
.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(), CustomResourceOptions.builder()
.dependsOn(scope)
.build());
}
}
resources:
scope:
type: gcp:gkehub:Scope
properties:
scopeId: tf-test-scope_27169
namespace:
type: gcp:gkehub:Namespace
properties:
scopeNamespaceId: tf-test-namespace_75223
scopeId: ${scope.scopeId}
scope: ${scope.name}
namespaceLabels:
keyb: valueb
keya: valuea
keyc: valuec
labels:
keyb: valueb
keya: valuea
keyc: valuec
options:
dependson:
- ${scope}

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:

$ pulumi import gcp:gkehub/namespace:Namespace default projects/{{project}}/locations/global/scopes/{{scope_id}}/namespaces/{{scope_namespace_id}}
$ pulumi import gcp:gkehub/namespace:Namespace default {{project}}/{{scope_id}}/{{scope_namespace_id}}
$ pulumi import gcp:gkehub/namespace:Namespace default {{scope_id}}/{{scope_namespace_id}}

Properties

Link copied to clipboard
val createTime: Output<String>

Time the Namespace was created in UTC.

Link copied to clipboard
val deleteTime: Output<String>

Time the Namespace was deleted in UTC.

Link copied to clipboard

All of labels (key/value pairs) present on the resource in GCP, including the labels configured through Pulumi, other clients and services.

Link copied to clipboard
val id: Output<String>
Link copied to clipboard
val labels: Output<Map<String, String>>?

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.

Link copied to clipboard
val name: Output<String>

The resource name for the namespace

Link copied to clipboard

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.

Link copied to clipboard
val project: Output<String>

The ID of the project in which the resource belongs. If it is not provided, the provider project is used.

Link copied to clipboard
val pulumiChildResources: Set<KotlinResource>
Link copied to clipboard
val pulumiLabels: Output<Map<String, String>>

The combination of labels configured directly on the resource and default labels configured on the provider.

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
val scope: Output<String>

The name of the Scope instance.

Link copied to clipboard
val scopeId: Output<String>

Id of the scope

Link copied to clipboard

The client-provided identifier of the namespace.

Link copied to clipboard
val states: Output<List<NamespaceState>>

State of the namespace resource. Structure is documented below.

Link copied to clipboard
val uid: Output<String>

Google-generated UUID for this resource.

Link copied to clipboard
val updateTime: Output<String>

Time the Namespace was updated in UTC.

Link copied to clipboard
val urn: Output<String>