1. Packages
  2. Oracle Cloud Infrastructure
  3. API Docs
  4. Identity
  5. getTagDefaults
Oracle Cloud Infrastructure v2.31.0 published on Thursday, Apr 17, 2025 by Pulumi

oci.Identity.getTagDefaults

Explore with Pulumi AI

Oracle Cloud Infrastructure v2.31.0 published on Thursday, Apr 17, 2025 by Pulumi

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

Lists the tag defaults for tag definitions in the specified compartment.

Example Usage

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

const testTagDefaults = oci.Identity.getTagDefaults({
    compartmentId: compartmentId,
    id: tagDefaultId,
    state: tagDefaultState,
    tagDefinitionId: testTagDefinition.id,
});
Copy
import pulumi
import pulumi_oci as oci

test_tag_defaults = oci.Identity.get_tag_defaults(compartment_id=compartment_id,
    id=tag_default_id,
    state=tag_default_state,
    tag_definition_id=test_tag_definition["id"])
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.GetTagDefaults(ctx, &identity.GetTagDefaultsArgs{
			CompartmentId:   pulumi.StringRef(compartmentId),
			Id:              pulumi.StringRef(tagDefaultId),
			State:           pulumi.StringRef(tagDefaultState),
			TagDefinitionId: pulumi.StringRef(testTagDefinition.Id),
		}, 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 testTagDefaults = Oci.Identity.GetTagDefaults.Invoke(new()
    {
        CompartmentId = compartmentId,
        Id = tagDefaultId,
        State = tagDefaultState,
        TagDefinitionId = testTagDefinition.Id,
    });

});
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.GetTagDefaultsArgs;
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 testTagDefaults = IdentityFunctions.getTagDefaults(GetTagDefaultsArgs.builder()
            .compartmentId(compartmentId)
            .id(tagDefaultId)
            .state(tagDefaultState)
            .tagDefinitionId(testTagDefinition.id())
            .build());

    }
}
Copy
variables:
  testTagDefaults:
    fn::invoke:
      function: oci:Identity:getTagDefaults
      arguments:
        compartmentId: ${compartmentId}
        id: ${tagDefaultId}
        state: ${tagDefaultState}
        tagDefinitionId: ${testTagDefinition.id}
Copy

Using getTagDefaults

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 getTagDefaults(args: GetTagDefaultsArgs, opts?: InvokeOptions): Promise<GetTagDefaultsResult>
function getTagDefaultsOutput(args: GetTagDefaultsOutputArgs, opts?: InvokeOptions): Output<GetTagDefaultsResult>
Copy
def get_tag_defaults(compartment_id: Optional[str] = None,
                     filters: Optional[Sequence[_identity.GetTagDefaultsFilter]] = None,
                     id: Optional[str] = None,
                     state: Optional[str] = None,
                     tag_definition_id: Optional[str] = None,
                     opts: Optional[InvokeOptions] = None) -> GetTagDefaultsResult
def get_tag_defaults_output(compartment_id: Optional[pulumi.Input[str]] = None,
                     filters: Optional[pulumi.Input[Sequence[pulumi.Input[_identity.GetTagDefaultsFilterArgs]]]] = None,
                     id: Optional[pulumi.Input[str]] = None,
                     state: Optional[pulumi.Input[str]] = None,
                     tag_definition_id: Optional[pulumi.Input[str]] = None,
                     opts: Optional[InvokeOptions] = None) -> Output[GetTagDefaultsResult]
Copy
func GetTagDefaults(ctx *Context, args *GetTagDefaultsArgs, opts ...InvokeOption) (*GetTagDefaultsResult, error)
func GetTagDefaultsOutput(ctx *Context, args *GetTagDefaultsOutputArgs, opts ...InvokeOption) GetTagDefaultsResultOutput
Copy

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

public static class GetTagDefaults 
{
    public static Task<GetTagDefaultsResult> InvokeAsync(GetTagDefaultsArgs args, InvokeOptions? opts = null)
    public static Output<GetTagDefaultsResult> Invoke(GetTagDefaultsInvokeArgs args, InvokeOptions? opts = null)
}
Copy
public static CompletableFuture<GetTagDefaultsResult> getTagDefaults(GetTagDefaultsArgs args, InvokeOptions options)
public static Output<GetTagDefaultsResult> getTagDefaults(GetTagDefaultsArgs args, InvokeOptions options)
Copy
fn::invoke:
  function: oci:Identity/getTagDefaults:getTagDefaults
  arguments:
    # arguments dictionary
Copy

The following arguments are supported:

CompartmentId string
The OCID of the compartment (remember that the tenancy is simply the root compartment).
Filters Changes to this property will trigger replacement. List<GetTagDefaultsFilter>
Id string
A filter to only return resources that match the specified OCID exactly.
State string
A filter to only return resources that match the given lifecycle state. The state value is case-insensitive.
TagDefinitionId string
The OCID of the tag definition.
CompartmentId string
The OCID of the compartment (remember that the tenancy is simply the root compartment).
Filters Changes to this property will trigger replacement. []GetTagDefaultsFilter
Id string
A filter to only return resources that match the specified OCID exactly.
State string
A filter to only return resources that match the given lifecycle state. The state value is case-insensitive.
TagDefinitionId string
The OCID of the tag definition.
compartmentId String
The OCID of the compartment (remember that the tenancy is simply the root compartment).
filters Changes to this property will trigger replacement. List<GetTagDefaultsFilter>
id String
A filter to only return resources that match the specified OCID exactly.
state String
A filter to only return resources that match the given lifecycle state. The state value is case-insensitive.
tagDefinitionId String
The OCID of the tag definition.
compartmentId string
The OCID of the compartment (remember that the tenancy is simply the root compartment).
filters Changes to this property will trigger replacement. GetTagDefaultsFilter[]
id string
A filter to only return resources that match the specified OCID exactly.
state string
A filter to only return resources that match the given lifecycle state. The state value is case-insensitive.
tagDefinitionId string
The OCID of the tag definition.
compartment_id 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.GetTagDefaultsFilter]
id str
A filter to only return resources that match the specified OCID exactly.
state str
A filter to only return resources that match the given lifecycle state. The state value is case-insensitive.
tag_definition_id str
The OCID of the tag definition.
compartmentId 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>
id String
A filter to only return resources that match the specified OCID exactly.
state String
A filter to only return resources that match the given lifecycle state. The state value is case-insensitive.
tagDefinitionId String
The OCID of the tag definition.

getTagDefaults Result

The following output properties are available:

TagDefaults List<GetTagDefaultsTagDefault>
The list of tag_defaults.
CompartmentId string
The OCID of the compartment. The tag default applies to all new resources that get created in the compartment. Resources that existed before the tag default was created are not tagged.
Filters List<GetTagDefaultsFilter>
Id string
The OCID of the tag default.
State string
The tag default's current state. After creating a TagDefault, make sure its lifecycleState is ACTIVE before using it.
TagDefinitionId string
The OCID of the tag definition. The tag default will always assign a default value for this tag definition.
TagDefaults []GetTagDefaultsTagDefault
The list of tag_defaults.
CompartmentId string
The OCID of the compartment. The tag default applies to all new resources that get created in the compartment. Resources that existed before the tag default was created are not tagged.
Filters []GetTagDefaultsFilter
Id string
The OCID of the tag default.
State string
The tag default's current state. After creating a TagDefault, make sure its lifecycleState is ACTIVE before using it.
TagDefinitionId string
The OCID of the tag definition. The tag default will always assign a default value for this tag definition.
tagDefaults List<GetTagDefaultsTagDefault>
The list of tag_defaults.
compartmentId String
The OCID of the compartment. The tag default applies to all new resources that get created in the compartment. Resources that existed before the tag default was created are not tagged.
filters List<GetTagDefaultsFilter>
id String
The OCID of the tag default.
state String
The tag default's current state. After creating a TagDefault, make sure its lifecycleState is ACTIVE before using it.
tagDefinitionId String
The OCID of the tag definition. The tag default will always assign a default value for this tag definition.
tagDefaults GetTagDefaultsTagDefault[]
The list of tag_defaults.
compartmentId string
The OCID of the compartment. The tag default applies to all new resources that get created in the compartment. Resources that existed before the tag default was created are not tagged.
filters GetTagDefaultsFilter[]
id string
The OCID of the tag default.
state string
The tag default's current state. After creating a TagDefault, make sure its lifecycleState is ACTIVE before using it.
tagDefinitionId string
The OCID of the tag definition. The tag default will always assign a default value for this tag definition.
tag_defaults Sequence[identity.GetTagDefaultsTagDefault]
The list of tag_defaults.
compartment_id str
The OCID of the compartment. The tag default applies to all new resources that get created in the compartment. Resources that existed before the tag default was created are not tagged.
filters Sequence[identity.GetTagDefaultsFilter]
id str
The OCID of the tag default.
state str
The tag default's current state. After creating a TagDefault, make sure its lifecycleState is ACTIVE before using it.
tag_definition_id str
The OCID of the tag definition. The tag default will always assign a default value for this tag definition.
tagDefaults List<Property Map>
The list of tag_defaults.
compartmentId String
The OCID of the compartment. The tag default applies to all new resources that get created in the compartment. Resources that existed before the tag default was created are not tagged.
filters List<Property Map>
id String
The OCID of the tag default.
state String
The tag default's current state. After creating a TagDefault, make sure its lifecycleState is ACTIVE before using it.
tagDefinitionId String
The OCID of the tag definition. The tag default will always assign a default value for this tag definition.

Supporting Types

GetTagDefaultsFilter

Name This property is required. string
Values This property is required. List<string>
Regex bool
Name This property is required. string
Values This property is required. []string
Regex bool
name This property is required. String
values This property is required. List<String>
regex Boolean
name This property is required. string
values This property is required. string[]
regex boolean
name This property is required. str
values This property is required. Sequence[str]
regex bool
name This property is required. String
values This property is required. List<String>
regex Boolean

GetTagDefaultsTagDefault

CompartmentId This property is required. string
The OCID of the compartment (remember that the tenancy is simply the root compartment).
Id This property is required. string
A filter to only return resources that match the specified OCID exactly.
IsRequired This property is required. bool
If you specify that a value is required, a value is set during resource creation (either by the user creating the resource or another tag defualt). If no value is set, resource creation is blocked.

  • If the isRequired flag is set to "true", the value is set during resource creation.
  • If the isRequired flag is set to "false", the value you enter is set during resource creation.
State This property is required. string
A filter to only return resources that match the given lifecycle state. The state value is case-insensitive.
TagDefinitionId This property is required. string
The OCID of the tag definition.
TagDefinitionName This property is required. string
The name used in the tag definition. This field is informational in the context of the tag default.
TagNamespaceId This property is required. string
The OCID of the tag namespace that contains the tag definition.
TimeCreated This property is required. string
Date and time the TagDefault object was created, in the format defined by RFC3339. Example: 2016-08-25T21:10:29.600Z
Value This property is required. string
The default value for the tag definition. This will be applied to all new resources created in the compartment.
CompartmentId This property is required. string
The OCID of the compartment (remember that the tenancy is simply the root compartment).
Id This property is required. string
A filter to only return resources that match the specified OCID exactly.
IsRequired This property is required. bool
If you specify that a value is required, a value is set during resource creation (either by the user creating the resource or another tag defualt). If no value is set, resource creation is blocked.

  • If the isRequired flag is set to "true", the value is set during resource creation.
  • If the isRequired flag is set to "false", the value you enter is set during resource creation.
State This property is required. string
A filter to only return resources that match the given lifecycle state. The state value is case-insensitive.
TagDefinitionId This property is required. string
The OCID of the tag definition.
TagDefinitionName This property is required. string
The name used in the tag definition. This field is informational in the context of the tag default.
TagNamespaceId This property is required. string
The OCID of the tag namespace that contains the tag definition.
TimeCreated This property is required. string
Date and time the TagDefault object was created, in the format defined by RFC3339. Example: 2016-08-25T21:10:29.600Z
Value This property is required. string
The default value for the tag definition. This will be applied to all new resources created in the compartment.
compartmentId This property is required. String
The OCID of the compartment (remember that the tenancy is simply the root compartment).
id This property is required. String
A filter to only return resources that match the specified OCID exactly.
isRequired This property is required. Boolean
If you specify that a value is required, a value is set during resource creation (either by the user creating the resource or another tag defualt). If no value is set, resource creation is blocked.

  • If the isRequired flag is set to "true", the value is set during resource creation.
  • If the isRequired flag is set to "false", the value you enter is set during resource creation.
state This property is required. String
A filter to only return resources that match the given lifecycle state. The state value is case-insensitive.
tagDefinitionId This property is required. String
The OCID of the tag definition.
tagDefinitionName This property is required. String
The name used in the tag definition. This field is informational in the context of the tag default.
tagNamespaceId This property is required. String
The OCID of the tag namespace that contains the tag definition.
timeCreated This property is required. String
Date and time the TagDefault object was created, in the format defined by RFC3339. Example: 2016-08-25T21:10:29.600Z
value This property is required. String
The default value for the tag definition. This will be applied to all new resources created in the compartment.
compartmentId This property is required. string
The OCID of the compartment (remember that the tenancy is simply the root compartment).
id This property is required. string
A filter to only return resources that match the specified OCID exactly.
isRequired This property is required. boolean
If you specify that a value is required, a value is set during resource creation (either by the user creating the resource or another tag defualt). If no value is set, resource creation is blocked.

  • If the isRequired flag is set to "true", the value is set during resource creation.
  • If the isRequired flag is set to "false", the value you enter is set during resource creation.
state This property is required. string
A filter to only return resources that match the given lifecycle state. The state value is case-insensitive.
tagDefinitionId This property is required. string
The OCID of the tag definition.
tagDefinitionName This property is required. string
The name used in the tag definition. This field is informational in the context of the tag default.
tagNamespaceId This property is required. string
The OCID of the tag namespace that contains the tag definition.
timeCreated This property is required. string
Date and time the TagDefault object was created, in the format defined by RFC3339. Example: 2016-08-25T21:10:29.600Z
value This property is required. string
The default value for the tag definition. This will be applied to all new resources created in the compartment.
compartment_id This property is required. str
The OCID of the compartment (remember that the tenancy is simply the root compartment).
id This property is required. str
A filter to only return resources that match the specified OCID exactly.
is_required This property is required. bool
If you specify that a value is required, a value is set during resource creation (either by the user creating the resource or another tag defualt). If no value is set, resource creation is blocked.

  • If the isRequired flag is set to "true", the value is set during resource creation.
  • If the isRequired flag is set to "false", the value you enter is set during resource creation.
state This property is required. str
A filter to only return resources that match the given lifecycle state. The state value is case-insensitive.
tag_definition_id This property is required. str
The OCID of the tag definition.
tag_definition_name This property is required. str
The name used in the tag definition. This field is informational in the context of the tag default.
tag_namespace_id This property is required. str
The OCID of the tag namespace that contains the tag definition.
time_created This property is required. str
Date and time the TagDefault object was created, in the format defined by RFC3339. Example: 2016-08-25T21:10:29.600Z
value This property is required. str
The default value for the tag definition. This will be applied to all new resources created in the compartment.
compartmentId This property is required. String
The OCID of the compartment (remember that the tenancy is simply the root compartment).
id This property is required. String
A filter to only return resources that match the specified OCID exactly.
isRequired This property is required. Boolean
If you specify that a value is required, a value is set during resource creation (either by the user creating the resource or another tag defualt). If no value is set, resource creation is blocked.

  • If the isRequired flag is set to "true", the value is set during resource creation.
  • If the isRequired flag is set to "false", the value you enter is set during resource creation.
state This property is required. String
A filter to only return resources that match the given lifecycle state. The state value is case-insensitive.
tagDefinitionId This property is required. String
The OCID of the tag definition.
tagDefinitionName This property is required. String
The name used in the tag definition. This field is informational in the context of the tag default.
tagNamespaceId This property is required. String
The OCID of the tag namespace that contains the tag definition.
timeCreated This property is required. String
Date and time the TagDefault object was created, in the format defined by RFC3339. Example: 2016-08-25T21:10:29.600Z
value This property is required. String
The default value for the tag definition. This will be applied to all new resources created in the compartment.

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.31.0 published on Thursday, Apr 17, 2025 by Pulumi