WorkloadIdentityPoolNamespace class
Represents a namespace for a workload identity pool. Namespaces are used to segment identities within the pool.
To get more information about WorkloadIdentityPoolNamespace, see:
- API documentation
- How-to Guides
- Configure managed workload identity authentication for Compute Engine
- Configure managed workload identity authentication for GKE
Example Usage
Iam Workload Identity Pool Namespace Basic
import * as pulumi from "@pulumi/pulumi";
import * as gcp from "@pulumi/gcp";
const pool = new gcp.iam.WorkloadIdentityPool("pool", {
workloadIdentityPoolId: "example-pool",
mode: "TRUST_DOMAIN",
});
const example = new gcp.iam.WorkloadIdentityPoolNamespace("example", {
workloadIdentityPoolId: pool.workloadIdentityPoolId,
workloadIdentityPoolNamespaceId: "example-namespace",
});
import pulumi
import pulumi_gcp as gcp
pool = gcp.iam.WorkloadIdentityPool("pool",
workload_identity_pool_id="example-pool",
mode="TRUST_DOMAIN")
example = gcp.iam.WorkloadIdentityPoolNamespace("example",
workload_identity_pool_id=pool.workload_identity_pool_id,
workload_identity_pool_namespace_id="example-namespace")
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Gcp = Pulumi.Gcp;
return await Deployment.RunAsync(() =>
{
var pool = new Gcp.Iam.WorkloadIdentityPool("pool", new()
{
WorkloadIdentityPoolId = "example-pool",
Mode = "TRUST_DOMAIN",
});
var example = new Gcp.Iam.WorkloadIdentityPoolNamespace("example", new()
{
WorkloadIdentityPoolId = pool.WorkloadIdentityPoolId,
WorkloadIdentityPoolNamespaceId = "example-namespace",
});
});
package main
import (
"github.com/pulumi/pulumi-gcp/sdk/v9/go/gcp/iam"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
pool, err := iam.NewWorkloadIdentityPool(ctx, "pool", &iam.WorkloadIdentityPoolArgs{
WorkloadIdentityPoolId: pulumi.String("example-pool"),
Mode: pulumi.String("TRUST_DOMAIN"),
})
if err != nil {
return err
}
_, err = iam.NewWorkloadIdentityPoolNamespace(ctx, "example", &iam.WorkloadIdentityPoolNamespaceArgs{
WorkloadIdentityPoolId: pool.WorkloadIdentityPoolId,
WorkloadIdentityPoolNamespaceId: pulumi.String("example-namespace"),
})
if err != nil {
return err
}
return nil
})
}
pulumi {
required_providers {
gcp = {
source = "pulumi/gcp"
}
}
}
resource "gcp_iam_workloadidentitypool" "pool" {
workload_identity_pool_id = "example-pool"
mode = "TRUST_DOMAIN"
}
resource "gcp_iam_workloadidentitypoolnamespace" "example" {
workload_identity_pool_id = gcp_iam_workloadidentitypool.pool.workload_identity_pool_id
workload_identity_pool_namespace_id = "example-namespace"
}
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.gcp.iam.WorkloadIdentityPool;
import com.pulumi.gcp.iam.WorkloadIdentityPoolArgs;
import com.pulumi.gcp.iam.WorkloadIdentityPoolNamespace;
import com.pulumi.gcp.iam.WorkloadIdentityPoolNamespaceArgs;
import java.util.ArrayList;
import java.util.Arrays;
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 pool = new WorkloadIdentityPool("pool", WorkloadIdentityPoolArgs.builder()
.workloadIdentityPoolId("example-pool")
.mode("TRUST_DOMAIN")
.build());
var example = new WorkloadIdentityPoolNamespace("example", WorkloadIdentityPoolNamespaceArgs.builder()
.workloadIdentityPoolId(pool.workloadIdentityPoolId())
.workloadIdentityPoolNamespaceId("example-namespace")
.build());
}
}
resources:
pool:
type: gcp:iam:WorkloadIdentityPool
properties:
workloadIdentityPoolId: example-pool
mode: TRUST_DOMAIN
example:
type: gcp:iam:WorkloadIdentityPoolNamespace
properties:
workloadIdentityPoolId: ${pool.workloadIdentityPoolId}
workloadIdentityPoolNamespaceId: example-namespace
Iam Workload Identity Pool Namespace Full
import * as pulumi from "@pulumi/pulumi";
import * as gcp from "@pulumi/gcp";
const pool = new gcp.iam.WorkloadIdentityPool("pool", {
workloadIdentityPoolId: "example-pool",
mode: "TRUST_DOMAIN",
});
const example = new gcp.iam.WorkloadIdentityPoolNamespace("example", {
workloadIdentityPoolId: pool.workloadIdentityPoolId,
workloadIdentityPoolNamespaceId: "example-namespace",
description: "Example Namespace in a Workload Identity Pool",
disabled: true,
});
import pulumi
import pulumi_gcp as gcp
pool = gcp.iam.WorkloadIdentityPool("pool",
workload_identity_pool_id="example-pool",
mode="TRUST_DOMAIN")
example = gcp.iam.WorkloadIdentityPoolNamespace("example",
workload_identity_pool_id=pool.workload_identity_pool_id,
workload_identity_pool_namespace_id="example-namespace",
description="Example Namespace in a Workload Identity Pool",
disabled=True)
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Gcp = Pulumi.Gcp;
return await Deployment.RunAsync(() =>
{
var pool = new Gcp.Iam.WorkloadIdentityPool("pool", new()
{
WorkloadIdentityPoolId = "example-pool",
Mode = "TRUST_DOMAIN",
});
var example = new Gcp.Iam.WorkloadIdentityPoolNamespace("example", new()
{
WorkloadIdentityPoolId = pool.WorkloadIdentityPoolId,
WorkloadIdentityPoolNamespaceId = "example-namespace",
Description = "Example Namespace in a Workload Identity Pool",
Disabled = true,
});
});
package main
import (
"github.com/pulumi/pulumi-gcp/sdk/v9/go/gcp/iam"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
pool, err := iam.NewWorkloadIdentityPool(ctx, "pool", &iam.WorkloadIdentityPoolArgs{
WorkloadIdentityPoolId: pulumi.String("example-pool"),
Mode: pulumi.String("TRUST_DOMAIN"),
})
if err != nil {
return err
}
_, err = iam.NewWorkloadIdentityPoolNamespace(ctx, "example", &iam.WorkloadIdentityPoolNamespaceArgs{
WorkloadIdentityPoolId: pool.WorkloadIdentityPoolId,
WorkloadIdentityPoolNamespaceId: pulumi.String("example-namespace"),
Description: pulumi.String("Example Namespace in a Workload Identity Pool"),
Disabled: pulumi.Bool(true),
})
if err != nil {
return err
}
return nil
})
}
pulumi {
required_providers {
gcp = {
source = "pulumi/gcp"
}
}
}
resource "gcp_iam_workloadidentitypool" "pool" {
workload_identity_pool_id = "example-pool"
mode = "TRUST_DOMAIN"
}
resource "gcp_iam_workloadidentitypoolnamespace" "example" {
workload_identity_pool_id = gcp_iam_workloadidentitypool.pool.workload_identity_pool_id
workload_identity_pool_namespace_id = "example-namespace"
description = "Example Namespace in a Workload Identity Pool"
disabled = true
}
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.gcp.iam.WorkloadIdentityPool;
import com.pulumi.gcp.iam.WorkloadIdentityPoolArgs;
import com.pulumi.gcp.iam.WorkloadIdentityPoolNamespace;
import com.pulumi.gcp.iam.WorkloadIdentityPoolNamespaceArgs;
import java.util.ArrayList;
import java.util.Arrays;
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 pool = new WorkloadIdentityPool("pool", WorkloadIdentityPoolArgs.builder()
.workloadIdentityPoolId("example-pool")
.mode("TRUST_DOMAIN")
.build());
var example = new WorkloadIdentityPoolNamespace("example", WorkloadIdentityPoolNamespaceArgs.builder()
.workloadIdentityPoolId(pool.workloadIdentityPoolId())
.workloadIdentityPoolNamespaceId("example-namespace")
.description("Example Namespace in a Workload Identity Pool")
.disabled(true)
.build());
}
}
resources:
pool:
type: gcp:iam:WorkloadIdentityPool
properties:
workloadIdentityPoolId: example-pool
mode: TRUST_DOMAIN
example:
type: gcp:iam:WorkloadIdentityPoolNamespace
properties:
workloadIdentityPoolId: ${pool.workloadIdentityPoolId}
workloadIdentityPoolNamespaceId: example-namespace
description: Example Namespace in a Workload Identity Pool
disabled: true
Import
WorkloadIdentityPoolNamespace can be imported using any of these accepted formats:
projects/{{project}}/locations/global/workloadIdentityPools/{{workload_identity_pool_id}}/namespaces/{{workload_identity_pool_namespace_id}}{{project}}/{{workload_identity_pool_id}}/{{workload_identity_pool_namespace_id}}{{workload_identity_pool_id}}/{{workload_identity_pool_namespace_id}}
When using the pulumi import command, WorkloadIdentityPoolNamespace can be imported using one of the formats above. For example:
$ pulumi import gcp:iam/workloadIdentityPoolNamespace:WorkloadIdentityPoolNamespace default projects/{{project}}/locations/global/workloadIdentityPools/{{workload_identity_pool_id}}/namespaces/{{workload_identity_pool_namespace_id}}
$ pulumi import gcp:iam/workloadIdentityPoolNamespace:WorkloadIdentityPoolNamespace default {{project}}/{{workload_identity_pool_id}}/{{workload_identity_pool_namespace_id}}
$ pulumi import gcp:iam/workloadIdentityPoolNamespace:WorkloadIdentityPoolNamespace default {{workload_identity_pool_id}}/{{workload_identity_pool_namespace_id}}
Constructors
- WorkloadIdentityPoolNamespace(String name, {WorkloadIdentityPoolNamespaceArgs? args, CustomResourceOptions? options})
-
Creates a new WorkloadIdentityPoolNamespace.
nameThe Pulumi resource name.argsArguments used to configure this WorkloadIdentityPoolNamespace. The set of arguments for WorkloadIdentityPoolNamespace.optionsResource options controlling this resource's behavior. - WorkloadIdentityPoolNamespace.reference(String urn)
- Creates a typed reference to an existing WorkloadIdentityPoolNamespace resource.
Properties
-
childResources
→ Set<
Resource> -
finalinherited
-
completionSources
↔ Map<
String, IOutputCompletionSource> -
latefinalinherited
-
deletionPolicy
↔ Output<
String> -
Whether Terraform will be prevented from destroying the resource. Defaults to DELETE.
When a 'terraform destroy' or 'pulumi up' would delete the resource,
the command will fail if this field is set to "PREVENT" in Terraform state.
When set to "ABANDON", the command will remove the resource from Terraform
management without updating or deleting the resource in the API.
When set to "DELETE", deleting the resource is allowed.
latefinal
-
description
↔ Output<
String?> -
A description of the namespace. Cannot exceed 256 characters.
latefinal
-
disabled
↔ Output<
bool?> -
Whether the namespace is disabled. If disabled, credentials may no longer be issued for
identities within this namespace, however existing credentials will still be accepted until
they expire.
latefinal
- hashCode → int
-
The hash code for this object.
no setterinherited
-
id
↔ Output<
String> -
getter/setter pairinherited
- isCustom → bool
-
Returns whether this resource is provider-managed.
no setterinherited
- isProtected → bool
-
Returns whether this resource is protected from deletion.
no setterinherited
- isRemote → bool
-
Whether this resource is registered as remote.
no setterinherited
- isResourceReference → bool
-
Whether this instance represents a resource value returned over RPC.
finalinherited
-
name
↔ Output<
String> -
The resource name of the namespace as
projects/{project_number}/locations/global/workloadIdentityPools/{workload_identity_pool_id}/namespaces/{workload_identity_pool_namespace_id}.latefinal -
ownerServices
↔ Output<
List< WorkloadIdentityPoolNamespaceOwnerService> > -
Defines the owner that is allowed to mutate this resource. If present, this resource can only
be mutated by the owner.
Structure is documented below.
latefinal
-
project
↔ Output<
String> -
The ID of the project in which the resource belongs.
If it is not provided, the provider project is used.
latefinal
-
resourceTransforms
→ List<
ResourceTransform> -
Inherited/explicit async transforms.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
-
state
↔ Output<
String> -
The current state of the namespace.
latefinal
-
transformations
→ List<
ResourceTransformation> -
Inherited/explicit legacy transformations.
no setterinherited
-
urn
↔ Output<
String> -
latefinalinherited
-
workloadIdentityPoolId
↔ Output<
String> -
The ID to use for the pool, which becomes the final component of the resource name. This
value should be 4-32 characters, and may contain the characters
a-z0-9-. The prefixgcp-is reserved for use by Google, and may not be specified.latefinal -
workloadIdentityPoolNamespaceId
↔ Output<
String> -
The ID to use for the namespace. This value must:
latefinal
Methods
-
failId(
Object error) → void -
Completes this resource ID with an error when registration fails.
inherited
-
failOutputs(
Object error) → void -
Completes all output properties with
error.inherited -
failUrn(
Object error) → void -
Completes this resource URN with an error when registration fails.
inherited
-
getProvider(
String moduleMember) → ProviderResource? -
Returns provider for
moduleMember's package, if configured.inherited -
getResourceName(
) → String -
Returns this resource's logical name.
inherited
-
getResourceType(
) → String -
Returns this resource's Pulumi type token.
inherited
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
registerOutput<
T> (String propertyName, {Object? decoder(Object?)?, bool isSecret = false}) → Output< T> -
Registers a dynamic output property for this resource.
inherited
-
resolveId(
String? value, {required bool isKnown}) → void -
Resolves the provider-assigned ID for this resource.
inherited
-
resolveOutputs(
Struct outputs) → void -
Resolves all output properties from a monitor response payload.
inherited
-
resolveUrn(
String value) → void -
Resolves this resource's URN once assigned by the engine.
inherited
-
serializeProperties(
Map< String, dynamic> properties) → Future<Struct> -
Serializes resource properties for RPC transmission.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Static Methods
-
get(
String name, Input< String> id, {WorkloadIdentityPoolNamespaceState? state, CustomResourceOptions? options}) → WorkloadIdentityPoolNamespace -
Gets an existing WorkloadIdentityPoolNamespace resource's state with the given
nameandid.