1. Packages
  2. Oracle Cloud Infrastructure
  3. API Docs
  4. Identity
  5. getTagDefaults
Oracle Cloud Infrastructure v2.3.0 published on Wednesday, Jul 17, 2024 by Pulumi

oci.Identity.getTagDefaults

Explore with Pulumi AI

oci logo
Oracle Cloud Infrastructure v2.3.0 published on Wednesday, Jul 17, 2024 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,
    });
    
    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"])
    
    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
    	})
    }
    
    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,
        });
    
    });
    
    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());
    
        }
    }
    
    variables:
      testTagDefaults:
        fn::invoke:
          Function: oci:Identity:getTagDefaults
          Arguments:
            compartmentId: ${compartmentId}
            id: ${tagDefaultId}
            state: ${tagDefaultState}
            tagDefinitionId: ${testTagDefinition.id}
    

    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>
    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]
    func GetTagDefaults(ctx *Context, args *GetTagDefaultsArgs, opts ...InvokeOption) (*GetTagDefaultsResult, error)
    func GetTagDefaultsOutput(ctx *Context, args *GetTagDefaultsOutputArgs, opts ...InvokeOption) GetTagDefaultsResultOutput

    > 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)
    }
    public static CompletableFuture<GetTagDefaultsResult> getTagDefaults(GetTagDefaultsArgs args, InvokeOptions options)
    // Output-based functions aren't available in Java yet
    
    fn::invoke:
      function: oci:Identity/getTagDefaults:getTagDefaults
      arguments:
        # arguments dictionary

    The following arguments are supported:

    CompartmentId string
    The OCID of the compartment (remember that the tenancy is simply the root compartment).
    Filters 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 []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 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 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 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 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 string
    Values List<string>
    Regex bool
    Name string
    Values []string
    Regex bool
    name String
    values List<String>
    regex Boolean
    name string
    values string[]
    regex boolean
    name str
    values Sequence[str]
    regex bool
    name String
    values List<String>
    regex Boolean

    GetTagDefaultsTagDefault

    CompartmentId string
    The OCID of the compartment (remember that the tenancy is simply the root compartment).
    Id string
    A filter to only return resources that match the specified OCID exactly.
    IsRequired 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 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.
    TagDefinitionName string
    The name used in the tag definition. This field is informational in the context of the tag default.
    TagNamespaceId string
    The OCID of the tag namespace that contains the tag definition.
    TimeCreated string
    Date and time the TagDefault object was created, in the format defined by RFC3339. Example: 2016-08-25T21:10:29.600Z
    Value string
    The default value for the tag definition. This will be applied to all new resources created in the compartment.
    CompartmentId string
    The OCID of the compartment (remember that the tenancy is simply the root compartment).
    Id string
    A filter to only return resources that match the specified OCID exactly.
    IsRequired 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 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.
    TagDefinitionName string
    The name used in the tag definition. This field is informational in the context of the tag default.
    TagNamespaceId string
    The OCID of the tag namespace that contains the tag definition.
    TimeCreated string
    Date and time the TagDefault object was created, in the format defined by RFC3339. Example: 2016-08-25T21:10:29.600Z
    Value string
    The default value for the tag definition. This will be applied to all new resources created in the compartment.
    compartmentId String
    The OCID of the compartment (remember that the tenancy is simply the root compartment).
    id String
    A filter to only return resources that match the specified OCID exactly.
    isRequired 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 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.
    tagDefinitionName String
    The name used in the tag definition. This field is informational in the context of the tag default.
    tagNamespaceId String
    The OCID of the tag namespace that contains the tag definition.
    timeCreated String
    Date and time the TagDefault object was created, in the format defined by RFC3339. Example: 2016-08-25T21:10:29.600Z
    value String
    The default value for the tag definition. This will be applied to all new resources created in the compartment.
    compartmentId string
    The OCID of the compartment (remember that the tenancy is simply the root compartment).
    id string
    A filter to only return resources that match the specified OCID exactly.
    isRequired 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 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.
    tagDefinitionName string
    The name used in the tag definition. This field is informational in the context of the tag default.
    tagNamespaceId string
    The OCID of the tag namespace that contains the tag definition.
    timeCreated string
    Date and time the TagDefault object was created, in the format defined by RFC3339. Example: 2016-08-25T21:10:29.600Z
    value string
    The default value for the tag definition. This will be applied to all new resources created in the compartment.
    compartment_id str
    The OCID of the compartment (remember that the tenancy is simply the root compartment).
    id str
    A filter to only return resources that match the specified OCID exactly.
    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 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.
    tag_definition_name str
    The name used in the tag definition. This field is informational in the context of the tag default.
    tag_namespace_id str
    The OCID of the tag namespace that contains the tag definition.
    time_created str
    Date and time the TagDefault object was created, in the format defined by RFC3339. Example: 2016-08-25T21:10:29.600Z
    value str
    The default value for the tag definition. This will be applied to all new resources created in the compartment.
    compartmentId String
    The OCID of the compartment (remember that the tenancy is simply the root compartment).
    id String
    A filter to only return resources that match the specified OCID exactly.
    isRequired 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 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.
    tagDefinitionName String
    The name used in the tag definition. This field is informational in the context of the tag default.
    tagNamespaceId String
    The OCID of the tag namespace that contains the tag definition.
    timeCreated String
    Date and time the TagDefault object was created, in the format defined by RFC3339. Example: 2016-08-25T21:10:29.600Z
    value 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.
    oci logo
    Oracle Cloud Infrastructure v2.3.0 published on Wednesday, Jul 17, 2024 by Pulumi