1. Packages
  2. Oracle Cloud Infrastructure
  3. API Docs
  4. Identity
  5. getTagNamespaces
Oracle Cloud Infrastructure v2.29.0 published on Wednesday, Apr 9, 2025 by Pulumi

oci.Identity.getTagNamespaces

Explore with Pulumi AI

Oracle Cloud Infrastructure v2.29.0 published on Wednesday, Apr 9, 2025 by Pulumi

This data source provides the list of Tag Namespaces in Oracle Cloud Infrastructure Identity service.

Lists the tag namespaces in the specified compartment.

Example Usage

import * as pulumi from "@pulumi/pulumi";
import * as oci from "@pulumi/oci";

const testTagNamespaces = oci.Identity.getTagNamespaces({
    compartmentId: compartmentId,
    includeSubcompartments: tagNamespaceIncludeSubcompartments,
    state: tagNamespaceState,
});
Copy
import pulumi
import pulumi_oci as oci

test_tag_namespaces = oci.Identity.get_tag_namespaces(compartment_id=compartment_id,
    include_subcompartments=tag_namespace_include_subcompartments,
    state=tag_namespace_state)
Copy
package main

import (
	"github.com/pulumi/pulumi-oci/sdk/v2/go/oci/identity"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := identity.GetTagNamespaces(ctx, &identity.GetTagNamespacesArgs{
			CompartmentId:          compartmentId,
			IncludeSubcompartments: pulumi.BoolRef(tagNamespaceIncludeSubcompartments),
			State:                  pulumi.StringRef(tagNamespaceState),
		}, nil)
		if err != nil {
			return err
		}
		return nil
	})
}
Copy
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Oci = Pulumi.Oci;

return await Deployment.RunAsync(() => 
{
    var testTagNamespaces = Oci.Identity.GetTagNamespaces.Invoke(new()
    {
        CompartmentId = compartmentId,
        IncludeSubcompartments = tagNamespaceIncludeSubcompartments,
        State = tagNamespaceState,
    });

});
Copy
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.oci.Identity.IdentityFunctions;
import com.pulumi.oci.Identity.inputs.GetTagNamespacesArgs;
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) {
        final var testTagNamespaces = IdentityFunctions.getTagNamespaces(GetTagNamespacesArgs.builder()
            .compartmentId(compartmentId)
            .includeSubcompartments(tagNamespaceIncludeSubcompartments)
            .state(tagNamespaceState)
            .build());

    }
}
Copy
variables:
  testTagNamespaces:
    fn::invoke:
      function: oci:Identity:getTagNamespaces
      arguments:
        compartmentId: ${compartmentId}
        includeSubcompartments: ${tagNamespaceIncludeSubcompartments}
        state: ${tagNamespaceState}
Copy

Using getTagNamespaces

Two invocation forms are available. The direct form accepts plain arguments and either blocks until the result value is available, or returns a Promise-wrapped result. The output form accepts Input-wrapped arguments and returns an Output-wrapped result.

function getTagNamespaces(args: GetTagNamespacesArgs, opts?: InvokeOptions): Promise<GetTagNamespacesResult>
function getTagNamespacesOutput(args: GetTagNamespacesOutputArgs, opts?: InvokeOptions): Output<GetTagNamespacesResult>
Copy
def get_tag_namespaces(compartment_id: Optional[str] = None,
                       filters: Optional[Sequence[_identity.GetTagNamespacesFilter]] = None,
                       include_subcompartments: Optional[bool] = None,
                       state: Optional[str] = None,
                       opts: Optional[InvokeOptions] = None) -> GetTagNamespacesResult
def get_tag_namespaces_output(compartment_id: Optional[pulumi.Input[str]] = None,
                       filters: Optional[pulumi.Input[Sequence[pulumi.Input[_identity.GetTagNamespacesFilterArgs]]]] = None,
                       include_subcompartments: Optional[pulumi.Input[bool]] = None,
                       state: Optional[pulumi.Input[str]] = None,
                       opts: Optional[InvokeOptions] = None) -> Output[GetTagNamespacesResult]
Copy
func GetTagNamespaces(ctx *Context, args *GetTagNamespacesArgs, opts ...InvokeOption) (*GetTagNamespacesResult, error)
func GetTagNamespacesOutput(ctx *Context, args *GetTagNamespacesOutputArgs, opts ...InvokeOption) GetTagNamespacesResultOutput
Copy

> Note: This function is named GetTagNamespaces in the Go SDK.

public static class GetTagNamespaces 
{
    public static Task<GetTagNamespacesResult> InvokeAsync(GetTagNamespacesArgs args, InvokeOptions? opts = null)
    public static Output<GetTagNamespacesResult> Invoke(GetTagNamespacesInvokeArgs args, InvokeOptions? opts = null)
}
Copy
public static CompletableFuture<GetTagNamespacesResult> getTagNamespaces(GetTagNamespacesArgs args, InvokeOptions options)
public static Output<GetTagNamespacesResult> getTagNamespaces(GetTagNamespacesArgs args, InvokeOptions options)
Copy
fn::invoke:
  function: oci:Identity/getTagNamespaces:getTagNamespaces
  arguments:
    # arguments dictionary
Copy

The following arguments are supported:

CompartmentId This property is required. string
The OCID of the compartment (remember that the tenancy is simply the root compartment).
Filters Changes to this property will trigger replacement. List<GetTagNamespacesFilter>
IncludeSubcompartments bool
An optional boolean parameter indicating whether to retrieve all tag namespaces in subcompartments. If this parameter is not specified, only the tag namespaces defined in the specified compartment are retrieved.
State string
A filter to only return resources that match the given lifecycle state. The state value is case-insensitive.
CompartmentId This property is required. string
The OCID of the compartment (remember that the tenancy is simply the root compartment).
Filters Changes to this property will trigger replacement. []GetTagNamespacesFilter
IncludeSubcompartments bool
An optional boolean parameter indicating whether to retrieve all tag namespaces in subcompartments. If this parameter is not specified, only the tag namespaces defined in the specified compartment are retrieved.
State string
A filter to only return resources that match the given lifecycle state. The state value is case-insensitive.
compartmentId This property is required. String
The OCID of the compartment (remember that the tenancy is simply the root compartment).
filters Changes to this property will trigger replacement. List<GetTagNamespacesFilter>
includeSubcompartments Boolean
An optional boolean parameter indicating whether to retrieve all tag namespaces in subcompartments. If this parameter is not specified, only the tag namespaces defined in the specified compartment are retrieved.
state String
A filter to only return resources that match the given lifecycle state. The state value is case-insensitive.
compartmentId This property is required. string
The OCID of the compartment (remember that the tenancy is simply the root compartment).
filters Changes to this property will trigger replacement. GetTagNamespacesFilter[]
includeSubcompartments boolean
An optional boolean parameter indicating whether to retrieve all tag namespaces in subcompartments. If this parameter is not specified, only the tag namespaces defined in the specified compartment are retrieved.
state string
A filter to only return resources that match the given lifecycle state. The state value is case-insensitive.
compartment_id This property is required. str
The OCID of the compartment (remember that the tenancy is simply the root compartment).
filters Changes to this property will trigger replacement. Sequence[identity.GetTagNamespacesFilter]
include_subcompartments bool
An optional boolean parameter indicating whether to retrieve all tag namespaces in subcompartments. If this parameter is not specified, only the tag namespaces defined in the specified compartment are retrieved.
state str
A filter to only return resources that match the given lifecycle state. The state value is case-insensitive.
compartmentId This property is required. String
The OCID of the compartment (remember that the tenancy is simply the root compartment).
filters Changes to this property will trigger replacement. List<Property Map>
includeSubcompartments Boolean
An optional boolean parameter indicating whether to retrieve all tag namespaces in subcompartments. If this parameter is not specified, only the tag namespaces defined in the specified compartment are retrieved.
state String
A filter to only return resources that match the given lifecycle state. The state value is case-insensitive.

getTagNamespaces Result

The following output properties are available:

CompartmentId string
The OCID of the compartment that contains the tag namespace.
Id string
The provider-assigned unique ID for this managed resource.
TagNamespaces List<GetTagNamespacesTagNamespace>
The list of tag_namespaces.
Filters List<GetTagNamespacesFilter>
IncludeSubcompartments bool
State string
The tagnamespace's current state. After creating a tagnamespace, make sure its lifecycleState is ACTIVE before using it. After retiring a tagnamespace, make sure its lifecycleState is INACTIVE before using it.
CompartmentId string
The OCID of the compartment that contains the tag namespace.
Id string
The provider-assigned unique ID for this managed resource.
TagNamespaces []GetTagNamespacesTagNamespace
The list of tag_namespaces.
Filters []GetTagNamespacesFilter
IncludeSubcompartments bool
State string
The tagnamespace's current state. After creating a tagnamespace, make sure its lifecycleState is ACTIVE before using it. After retiring a tagnamespace, make sure its lifecycleState is INACTIVE before using it.
compartmentId String
The OCID of the compartment that contains the tag namespace.
id String
The provider-assigned unique ID for this managed resource.
tagNamespaces List<GetTagNamespacesTagNamespace>
The list of tag_namespaces.
filters List<GetTagNamespacesFilter>
includeSubcompartments Boolean
state String
The tagnamespace's current state. After creating a tagnamespace, make sure its lifecycleState is ACTIVE before using it. After retiring a tagnamespace, make sure its lifecycleState is INACTIVE before using it.
compartmentId string
The OCID of the compartment that contains the tag namespace.
id string
The provider-assigned unique ID for this managed resource.
tagNamespaces GetTagNamespacesTagNamespace[]
The list of tag_namespaces.
filters GetTagNamespacesFilter[]
includeSubcompartments boolean
state string
The tagnamespace's current state. After creating a tagnamespace, make sure its lifecycleState is ACTIVE before using it. After retiring a tagnamespace, make sure its lifecycleState is INACTIVE before using it.
compartment_id str
The OCID of the compartment that contains the tag namespace.
id str
The provider-assigned unique ID for this managed resource.
tag_namespaces Sequence[identity.GetTagNamespacesTagNamespace]
The list of tag_namespaces.
filters Sequence[identity.GetTagNamespacesFilter]
include_subcompartments bool
state str
The tagnamespace's current state. After creating a tagnamespace, make sure its lifecycleState is ACTIVE before using it. After retiring a tagnamespace, make sure its lifecycleState is INACTIVE before using it.
compartmentId String
The OCID of the compartment that contains the tag namespace.
id String
The provider-assigned unique ID for this managed resource.
tagNamespaces List<Property Map>
The list of tag_namespaces.
filters List<Property Map>
includeSubcompartments Boolean
state String
The tagnamespace's current state. After creating a tagnamespace, make sure its lifecycleState is ACTIVE before using it. After retiring a tagnamespace, make sure its lifecycleState is INACTIVE before using it.

Supporting Types

GetTagNamespacesFilter

Name This property is required. string
The name of the tag namespace. It must be unique across all tag namespaces in the tenancy and cannot be changed.
Values This property is required. List<string>
Regex bool
Name This property is required. string
The name of the tag namespace. It must be unique across all tag namespaces in the tenancy and cannot be changed.
Values This property is required. []string
Regex bool
name This property is required. String
The name of the tag namespace. It must be unique across all tag namespaces in the tenancy and cannot be changed.
values This property is required. List<String>
regex Boolean
name This property is required. string
The name of the tag namespace. It must be unique across all tag namespaces in the tenancy and cannot be changed.
values This property is required. string[]
regex boolean
name This property is required. str
The name of the tag namespace. It must be unique across all tag namespaces in the tenancy and cannot be changed.
values This property is required. Sequence[str]
regex bool
name This property is required. String
The name of the tag namespace. It must be unique across all tag namespaces in the tenancy and cannot be changed.
values This property is required. List<String>
regex Boolean

GetTagNamespacesTagNamespace

CompartmentId This property is required. string
The OCID of the compartment (remember that the tenancy is simply the root compartment).
DefinedTags This property is required. Dictionary<string, string>
Defined tags for this resource. Each key is predefined and scoped to a namespace. For more information, see Resource Tags. Example: {"Operations.CostCenter": "42"}
Description This property is required. string
The description you assign to the tag namespace.
FreeformTags This property is required. Dictionary<string, string>
Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. For more information, see Resource Tags. Example: {"Department": "Finance"}
Id This property is required. string
The OCID of the tag namespace.
IsRetired This property is required. bool
Whether the tag namespace is retired. For more information, see Retiring Key Definitions and Namespace Definitions.
Name This property is required. string
The name of the tag namespace. It must be unique across all tag namespaces in the tenancy and cannot be changed.
State This property is required. string
A filter to only return resources that match the given lifecycle state. The state value is case-insensitive.
TimeCreated This property is required. string
Date and time the tag namespace was created, in the format defined by RFC3339. Example: 2016-08-25T21:10:29.600Z
CompartmentId This property is required. string
The OCID of the compartment (remember that the tenancy is simply the root compartment).
DefinedTags This property is required. map[string]string
Defined tags for this resource. Each key is predefined and scoped to a namespace. For more information, see Resource Tags. Example: {"Operations.CostCenter": "42"}
Description This property is required. string
The description you assign to the tag namespace.
FreeformTags This property is required. map[string]string
Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. For more information, see Resource Tags. Example: {"Department": "Finance"}
Id This property is required. string
The OCID of the tag namespace.
IsRetired This property is required. bool
Whether the tag namespace is retired. For more information, see Retiring Key Definitions and Namespace Definitions.
Name This property is required. string
The name of the tag namespace. It must be unique across all tag namespaces in the tenancy and cannot be changed.
State This property is required. string
A filter to only return resources that match the given lifecycle state. The state value is case-insensitive.
TimeCreated This property is required. string
Date and time the tag namespace was created, in the format defined by RFC3339. Example: 2016-08-25T21:10:29.600Z
compartmentId This property is required. String
The OCID of the compartment (remember that the tenancy is simply the root compartment).
definedTags This property is required. Map<String,String>
Defined tags for this resource. Each key is predefined and scoped to a namespace. For more information, see Resource Tags. Example: {"Operations.CostCenter": "42"}
description This property is required. String
The description you assign to the tag namespace.
freeformTags This property is required. Map<String,String>
Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. For more information, see Resource Tags. Example: {"Department": "Finance"}
id This property is required. String
The OCID of the tag namespace.
isRetired This property is required. Boolean
Whether the tag namespace is retired. For more information, see Retiring Key Definitions and Namespace Definitions.
name This property is required. String
The name of the tag namespace. It must be unique across all tag namespaces in the tenancy and cannot be changed.
state This property is required. String
A filter to only return resources that match the given lifecycle state. The state value is case-insensitive.
timeCreated This property is required. String
Date and time the tag namespace was created, in the format defined by RFC3339. Example: 2016-08-25T21:10:29.600Z
compartmentId This property is required. string
The OCID of the compartment (remember that the tenancy is simply the root compartment).
definedTags This property is required. {[key: string]: string}
Defined tags for this resource. Each key is predefined and scoped to a namespace. For more information, see Resource Tags. Example: {"Operations.CostCenter": "42"}
description This property is required. string
The description you assign to the tag namespace.
freeformTags This property is required. {[key: string]: string}
Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. For more information, see Resource Tags. Example: {"Department": "Finance"}
id This property is required. string
The OCID of the tag namespace.
isRetired This property is required. boolean
Whether the tag namespace is retired. For more information, see Retiring Key Definitions and Namespace Definitions.
name This property is required. string
The name of the tag namespace. It must be unique across all tag namespaces in the tenancy and cannot be changed.
state This property is required. string
A filter to only return resources that match the given lifecycle state. The state value is case-insensitive.
timeCreated This property is required. string
Date and time the tag namespace was created, in the format defined by RFC3339. Example: 2016-08-25T21:10:29.600Z
compartment_id This property is required. str
The OCID of the compartment (remember that the tenancy is simply the root compartment).
defined_tags This property is required. Mapping[str, str]
Defined tags for this resource. Each key is predefined and scoped to a namespace. For more information, see Resource Tags. Example: {"Operations.CostCenter": "42"}
description This property is required. str
The description you assign to the tag namespace.
freeform_tags This property is required. Mapping[str, str]
Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. For more information, see Resource Tags. Example: {"Department": "Finance"}
id This property is required. str
The OCID of the tag namespace.
is_retired This property is required. bool
Whether the tag namespace is retired. For more information, see Retiring Key Definitions and Namespace Definitions.
name This property is required. str
The name of the tag namespace. It must be unique across all tag namespaces in the tenancy and cannot be changed.
state This property is required. str
A filter to only return resources that match the given lifecycle state. The state value is case-insensitive.
time_created This property is required. str
Date and time the tag namespace was created, in the format defined by RFC3339. Example: 2016-08-25T21:10:29.600Z
compartmentId This property is required. String
The OCID of the compartment (remember that the tenancy is simply the root compartment).
definedTags This property is required. Map<String>
Defined tags for this resource. Each key is predefined and scoped to a namespace. For more information, see Resource Tags. Example: {"Operations.CostCenter": "42"}
description This property is required. String
The description you assign to the tag namespace.
freeformTags This property is required. Map<String>
Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. For more information, see Resource Tags. Example: {"Department": "Finance"}
id This property is required. String
The OCID of the tag namespace.
isRetired This property is required. Boolean
Whether the tag namespace is retired. For more information, see Retiring Key Definitions and Namespace Definitions.
name This property is required. String
The name of the tag namespace. It must be unique across all tag namespaces in the tenancy and cannot be changed.
state This property is required. String
A filter to only return resources that match the given lifecycle state. The state value is case-insensitive.
timeCreated This property is required. String
Date and time the tag namespace was created, in the format defined by RFC3339. Example: 2016-08-25T21:10:29.600Z

Package Details

Repository
oci pulumi/pulumi-oci
License
Apache-2.0
Notes
This Pulumi package is based on the oci Terraform Provider.
Oracle Cloud Infrastructure v2.29.0 published on Wednesday, Apr 9, 2025 by Pulumi