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

oci.Identity.getTag

Explore with Pulumi AI

oci logo
Oracle Cloud Infrastructure v2.3.0 published on Wednesday, Jul 17, 2024 by Pulumi

    This data source provides details about a specific Tag resource in Oracle Cloud Infrastructure Identity service.

    Gets the specified tag’s information.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as oci from "@pulumi/oci";
    
    const testTag = oci.Identity.getTag({
        tagName: testTagOciIdentityTag.name,
        tagNamespaceId: testTagNamespace.id,
    });
    
    import pulumi
    import pulumi_oci as oci
    
    test_tag = oci.Identity.get_tag(tag_name=test_tag_oci_identity_tag["name"],
        tag_namespace_id=test_tag_namespace["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.GetTag(ctx, &identity.GetTagArgs{
    			TagName:        testTagOciIdentityTag.Name,
    			TagNamespaceId: testTagNamespace.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 testTag = Oci.Identity.GetTag.Invoke(new()
        {
            TagName = testTagOciIdentityTag.Name,
            TagNamespaceId = testTagNamespace.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.GetTagArgs;
    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 testTag = IdentityFunctions.getTag(GetTagArgs.builder()
                .tagName(testTagOciIdentityTag.name())
                .tagNamespaceId(testTagNamespace.id())
                .build());
    
        }
    }
    
    variables:
      testTag:
        fn::invoke:
          Function: oci:Identity:getTag
          Arguments:
            tagName: ${testTagOciIdentityTag.name}
            tagNamespaceId: ${testTagNamespace.id}
    

    Using getTag

    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 getTag(args: GetTagArgs, opts?: InvokeOptions): Promise<GetTagResult>
    function getTagOutput(args: GetTagOutputArgs, opts?: InvokeOptions): Output<GetTagResult>
    def get_tag(tag_name: Optional[str] = None,
                tag_namespace_id: Optional[str] = None,
                opts: Optional[InvokeOptions] = None) -> GetTagResult
    def get_tag_output(tag_name: Optional[pulumi.Input[str]] = None,
                tag_namespace_id: Optional[pulumi.Input[str]] = None,
                opts: Optional[InvokeOptions] = None) -> Output[GetTagResult]
    func GetTag(ctx *Context, args *GetTagArgs, opts ...InvokeOption) (*GetTagResult, error)
    func GetTagOutput(ctx *Context, args *GetTagOutputArgs, opts ...InvokeOption) GetTagResultOutput

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

    public static class GetTag 
    {
        public static Task<GetTagResult> InvokeAsync(GetTagArgs args, InvokeOptions? opts = null)
        public static Output<GetTagResult> Invoke(GetTagInvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetTagResult> getTag(GetTagArgs args, InvokeOptions options)
    // Output-based functions aren't available in Java yet
    
    fn::invoke:
      function: oci:Identity/getTag:getTag
      arguments:
        # arguments dictionary

    The following arguments are supported:

    TagName string
    The name of the tag.
    TagNamespaceId string
    The OCID of the tag namespace.
    TagName string
    The name of the tag.
    TagNamespaceId string
    The OCID of the tag namespace.
    tagName String
    The name of the tag.
    tagNamespaceId String
    The OCID of the tag namespace.
    tagName string
    The name of the tag.
    tagNamespaceId string
    The OCID of the tag namespace.
    tag_name str
    The name of the tag.
    tag_namespace_id str
    The OCID of the tag namespace.
    tagName String
    The name of the tag.
    tagNamespaceId String
    The OCID of the tag namespace.

    getTag Result

    The following output properties are available:

    DefinedTags Dictionary<string, object>
    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 string
    The description you assign to the tag.
    FreeformTags Dictionary<string, object>
    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 string
    The OCID of the tag definition.
    IsCostTracking bool
    Indicates whether the tag is enabled for cost tracking.
    IsRetired bool
    Indicates whether the tag is retired. See Retiring Key Definitions and Namespace Definitions.
    Name string
    The name assigned to the tag during creation. This is the tag key definition. The name must be unique within the tag namespace and cannot be changed.
    State string
    The tag's current state. After creating a tag, make sure its lifecycleState is ACTIVE before using it. After retiring a tag, make sure its lifecycleState is INACTIVE before using it. If you delete a tag, you cannot delete another tag until the deleted tag's lifecycleState changes from DELETING to DELETED.
    TagName string
    TagNamespaceId string
    The OCID of the namespace that contains the tag definition.
    TimeCreated string
    Date and time the tag was created, in the format defined by RFC3339. Example: 2016-08-25T21:10:29.600Z
    Validators List<GetTagValidator>
    Validates a definedTag value. Each validator performs validation steps in addition to the standard validation for definedTag values. For more information, see Limits on Tags.
    DefinedTags map[string]interface{}
    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 string
    The description you assign to the tag.
    FreeformTags map[string]interface{}
    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 string
    The OCID of the tag definition.
    IsCostTracking bool
    Indicates whether the tag is enabled for cost tracking.
    IsRetired bool
    Indicates whether the tag is retired. See Retiring Key Definitions and Namespace Definitions.
    Name string
    The name assigned to the tag during creation. This is the tag key definition. The name must be unique within the tag namespace and cannot be changed.
    State string
    The tag's current state. After creating a tag, make sure its lifecycleState is ACTIVE before using it. After retiring a tag, make sure its lifecycleState is INACTIVE before using it. If you delete a tag, you cannot delete another tag until the deleted tag's lifecycleState changes from DELETING to DELETED.
    TagName string
    TagNamespaceId string
    The OCID of the namespace that contains the tag definition.
    TimeCreated string
    Date and time the tag was created, in the format defined by RFC3339. Example: 2016-08-25T21:10:29.600Z
    Validators []GetTagValidator
    Validates a definedTag value. Each validator performs validation steps in addition to the standard validation for definedTag values. For more information, see Limits on Tags.
    definedTags Map<String,Object>
    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 String
    The description you assign to the tag.
    freeformTags Map<String,Object>
    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 String
    The OCID of the tag definition.
    isCostTracking Boolean
    Indicates whether the tag is enabled for cost tracking.
    isRetired Boolean
    Indicates whether the tag is retired. See Retiring Key Definitions and Namespace Definitions.
    name String
    The name assigned to the tag during creation. This is the tag key definition. The name must be unique within the tag namespace and cannot be changed.
    state String
    The tag's current state. After creating a tag, make sure its lifecycleState is ACTIVE before using it. After retiring a tag, make sure its lifecycleState is INACTIVE before using it. If you delete a tag, you cannot delete another tag until the deleted tag's lifecycleState changes from DELETING to DELETED.
    tagName String
    tagNamespaceId String
    The OCID of the namespace that contains the tag definition.
    timeCreated String
    Date and time the tag was created, in the format defined by RFC3339. Example: 2016-08-25T21:10:29.600Z
    validators List<GetTagValidator>
    Validates a definedTag value. Each validator performs validation steps in addition to the standard validation for definedTag values. For more information, see Limits on Tags.
    definedTags {[key: string]: any}
    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 string
    The description you assign to the tag.
    freeformTags {[key: string]: any}
    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 string
    The OCID of the tag definition.
    isCostTracking boolean
    Indicates whether the tag is enabled for cost tracking.
    isRetired boolean
    Indicates whether the tag is retired. See Retiring Key Definitions and Namespace Definitions.
    name string
    The name assigned to the tag during creation. This is the tag key definition. The name must be unique within the tag namespace and cannot be changed.
    state string
    The tag's current state. After creating a tag, make sure its lifecycleState is ACTIVE before using it. After retiring a tag, make sure its lifecycleState is INACTIVE before using it. If you delete a tag, you cannot delete another tag until the deleted tag's lifecycleState changes from DELETING to DELETED.
    tagName string
    tagNamespaceId string
    The OCID of the namespace that contains the tag definition.
    timeCreated string
    Date and time the tag was created, in the format defined by RFC3339. Example: 2016-08-25T21:10:29.600Z
    validators GetTagValidator[]
    Validates a definedTag value. Each validator performs validation steps in addition to the standard validation for definedTag values. For more information, see Limits on Tags.
    defined_tags Mapping[str, Any]
    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 str
    The description you assign to the tag.
    freeform_tags Mapping[str, Any]
    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 str
    The OCID of the tag definition.
    is_cost_tracking bool
    Indicates whether the tag is enabled for cost tracking.
    is_retired bool
    Indicates whether the tag is retired. See Retiring Key Definitions and Namespace Definitions.
    name str
    The name assigned to the tag during creation. This is the tag key definition. The name must be unique within the tag namespace and cannot be changed.
    state str
    The tag's current state. After creating a tag, make sure its lifecycleState is ACTIVE before using it. After retiring a tag, make sure its lifecycleState is INACTIVE before using it. If you delete a tag, you cannot delete another tag until the deleted tag's lifecycleState changes from DELETING to DELETED.
    tag_name str
    tag_namespace_id str
    The OCID of the namespace that contains the tag definition.
    time_created str
    Date and time the tag was created, in the format defined by RFC3339. Example: 2016-08-25T21:10:29.600Z
    validators Sequence[identity.GetTagValidator]
    Validates a definedTag value. Each validator performs validation steps in addition to the standard validation for definedTag values. For more information, see Limits on Tags.
    definedTags Map<Any>
    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 String
    The description you assign to the tag.
    freeformTags Map<Any>
    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 String
    The OCID of the tag definition.
    isCostTracking Boolean
    Indicates whether the tag is enabled for cost tracking.
    isRetired Boolean
    Indicates whether the tag is retired. See Retiring Key Definitions and Namespace Definitions.
    name String
    The name assigned to the tag during creation. This is the tag key definition. The name must be unique within the tag namespace and cannot be changed.
    state String
    The tag's current state. After creating a tag, make sure its lifecycleState is ACTIVE before using it. After retiring a tag, make sure its lifecycleState is INACTIVE before using it. If you delete a tag, you cannot delete another tag until the deleted tag's lifecycleState changes from DELETING to DELETED.
    tagName String
    tagNamespaceId String
    The OCID of the namespace that contains the tag definition.
    timeCreated String
    Date and time the tag was created, in the format defined by RFC3339. Example: 2016-08-25T21:10:29.600Z
    validators List<Property Map>
    Validates a definedTag value. Each validator performs validation steps in addition to the standard validation for definedTag values. For more information, see Limits on Tags.

    Supporting Types

    GetTagValidator

    ValidatorType string
    Specifies the type of validation: a static value (no validation) or a list.
    Values List<string>
    The list of allowed values for a definedTag value.
    ValidatorType string
    Specifies the type of validation: a static value (no validation) or a list.
    Values []string
    The list of allowed values for a definedTag value.
    validatorType String
    Specifies the type of validation: a static value (no validation) or a list.
    values List<String>
    The list of allowed values for a definedTag value.
    validatorType string
    Specifies the type of validation: a static value (no validation) or a list.
    values string[]
    The list of allowed values for a definedTag value.
    validator_type str
    Specifies the type of validation: a static value (no validation) or a list.
    values Sequence[str]
    The list of allowed values for a definedTag value.
    validatorType String
    Specifies the type of validation: a static value (no validation) or a list.
    values List<String>
    The list of allowed values for a definedTag value.

    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