Oracle Cloud Infrastructure v2.33.0 published on Thursday, May 1, 2025 by Pulumi
oci.Identity.getCostTrackingTags
Explore with Pulumi AI
This data source provides the list of Cost Tracking Tags in Oracle Cloud Infrastructure Identity service.
Lists all the tags enabled for cost-tracking in the specified tenancy. For information about cost-tracking tags, see Using Cost-tracking Tags.
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as oci from "@pulumi/oci";
const testCostTrackingTags = oci.Identity.getCostTrackingTags({
    compartmentId: compartmentId,
});
import pulumi
import pulumi_oci as oci
test_cost_tracking_tags = oci.Identity.get_cost_tracking_tags(compartment_id=compartment_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.GetCostTrackingTags(ctx, &identity.GetCostTrackingTagsArgs{
			CompartmentId: compartmentId,
		}, 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 testCostTrackingTags = Oci.Identity.GetCostTrackingTags.Invoke(new()
    {
        CompartmentId = compartmentId,
    });
});
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.GetCostTrackingTagsArgs;
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 testCostTrackingTags = IdentityFunctions.getCostTrackingTags(GetCostTrackingTagsArgs.builder()
            .compartmentId(compartmentId)
            .build());
    }
}
variables:
  testCostTrackingTags:
    fn::invoke:
      function: oci:Identity:getCostTrackingTags
      arguments:
        compartmentId: ${compartmentId}
Using getCostTrackingTags
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 getCostTrackingTags(args: GetCostTrackingTagsArgs, opts?: InvokeOptions): Promise<GetCostTrackingTagsResult>
function getCostTrackingTagsOutput(args: GetCostTrackingTagsOutputArgs, opts?: InvokeOptions): Output<GetCostTrackingTagsResult>def get_cost_tracking_tags(compartment_id: Optional[str] = None,
                           filters: Optional[Sequence[GetCostTrackingTagsFilter]] = None,
                           opts: Optional[InvokeOptions] = None) -> GetCostTrackingTagsResult
def get_cost_tracking_tags_output(compartment_id: Optional[pulumi.Input[str]] = None,
                           filters: Optional[pulumi.Input[Sequence[pulumi.Input[GetCostTrackingTagsFilterArgs]]]] = None,
                           opts: Optional[InvokeOptions] = None) -> Output[GetCostTrackingTagsResult]func GetCostTrackingTags(ctx *Context, args *GetCostTrackingTagsArgs, opts ...InvokeOption) (*GetCostTrackingTagsResult, error)
func GetCostTrackingTagsOutput(ctx *Context, args *GetCostTrackingTagsOutputArgs, opts ...InvokeOption) GetCostTrackingTagsResultOutput> Note: This function is named GetCostTrackingTags in the Go SDK.
public static class GetCostTrackingTags 
{
    public static Task<GetCostTrackingTagsResult> InvokeAsync(GetCostTrackingTagsArgs args, InvokeOptions? opts = null)
    public static Output<GetCostTrackingTagsResult> Invoke(GetCostTrackingTagsInvokeArgs args, InvokeOptions? opts = null)
}public static CompletableFuture<GetCostTrackingTagsResult> getCostTrackingTags(GetCostTrackingTagsArgs args, InvokeOptions options)
public static Output<GetCostTrackingTagsResult> getCostTrackingTags(GetCostTrackingTagsArgs args, InvokeOptions options)
fn::invoke:
  function: oci:Identity/getCostTrackingTags:getCostTrackingTags
  arguments:
    # arguments dictionaryThe following arguments are supported:
- CompartmentId string
- The OCID of the compartment (remember that the tenancy is simply the root compartment).
- Filters
List<GetCost Tracking Tags Filter> 
- CompartmentId string
- The OCID of the compartment (remember that the tenancy is simply the root compartment).
- Filters
[]GetCost Tracking Tags Filter 
- compartmentId String
- The OCID of the compartment (remember that the tenancy is simply the root compartment).
- filters
List<GetCost Tracking Tags Filter> 
- compartmentId string
- The OCID of the compartment (remember that the tenancy is simply the root compartment).
- filters
GetCost Tracking Tags Filter[] 
- compartment_id str
- The OCID of the compartment (remember that the tenancy is simply the root compartment).
- filters
Sequence[GetCost Tracking Tags Filter] 
- compartmentId String
- The OCID of the compartment (remember that the tenancy is simply the root compartment).
- filters List<Property Map>
getCostTrackingTags Result
The following output properties are available:
- CompartmentId string
- The OCID of the compartment that contains the tag definition.
- Id string
- The provider-assigned unique ID for this managed resource.
- 
List<GetCost Tracking Tags Tag> 
- The list of tags.
- Filters
List<GetCost Tracking Tags Filter> 
- CompartmentId string
- The OCID of the compartment that contains the tag definition.
- Id string
- The provider-assigned unique ID for this managed resource.
- 
[]GetCost Tracking Tags Tag 
- The list of tags.
- Filters
[]GetCost Tracking Tags Filter 
- compartmentId String
- The OCID of the compartment that contains the tag definition.
- id String
- The provider-assigned unique ID for this managed resource.
- 
List<GetCost Tracking Tags Tag> 
- The list of tags.
- filters
List<GetCost Tracking Tags Filter> 
- compartmentId string
- The OCID of the compartment that contains the tag definition.
- id string
- The provider-assigned unique ID for this managed resource.
- 
GetCost Tracking Tags Tag[] 
- The list of tags.
- filters
GetCost Tracking Tags Filter[] 
- compartment_id str
- The OCID of the compartment that contains the tag definition.
- id str
- The provider-assigned unique ID for this managed resource.
- 
Sequence[GetCost Tracking Tags Tag] 
- The list of tags.
- filters
Sequence[GetCost Tracking Tags Filter] 
- compartmentId String
- The OCID of the compartment that contains the tag definition.
- id String
- The provider-assigned unique ID for this managed resource.
- List<Property Map>
- The list of tags.
- filters List<Property Map>
Supporting Types
GetCostTrackingTagsFilter    
GetCostTrackingTagsTag    
- CompartmentId string
- The OCID of the compartment (remember that the tenancy is simply the root compartment).
- 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 string
- The description you assign to the tag.
- 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 string
- The OCID of the tag definition.
- IsCost boolTracking 
- 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 lifecycleStateis ACTIVE before using it. After retiring a tag, make sure itslifecycleStateis INACTIVE before using it. If you delete a tag, you cannot delete another tag until the deleted tag'slifecycleStatechanges from DELETING to DELETED.
- TagNamespace stringId 
- The OCID of the namespace that contains the tag definition.
- TagNamespace stringName 
- The name of the tag 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<GetCost Tracking Tags Tag Validator> 
- 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.
- CompartmentId string
- The OCID of the compartment (remember that the tenancy is simply the root compartment).
- 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 string
- The description you assign to the tag.
- 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 string
- The OCID of the tag definition.
- IsCost boolTracking 
- 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 lifecycleStateis ACTIVE before using it. After retiring a tag, make sure itslifecycleStateis INACTIVE before using it. If you delete a tag, you cannot delete another tag until the deleted tag'slifecycleStatechanges from DELETING to DELETED.
- TagNamespace stringId 
- The OCID of the namespace that contains the tag definition.
- TagNamespace stringName 
- The name of the tag 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
[]GetCost Tracking Tags Tag Validator 
- 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.
- compartmentId String
- The OCID of the compartment (remember that the tenancy is simply the root compartment).
- 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 String
- The description you assign to the tag.
- 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 String
- The OCID of the tag definition.
- isCost BooleanTracking 
- 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 lifecycleStateis ACTIVE before using it. After retiring a tag, make sure itslifecycleStateis INACTIVE before using it. If you delete a tag, you cannot delete another tag until the deleted tag'slifecycleStatechanges from DELETING to DELETED.
- tagNamespace StringId 
- The OCID of the namespace that contains the tag definition.
- tagNamespace StringName 
- The name of the tag 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<GetCost Tracking Tags Tag Validator> 
- 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.
- compartmentId string
- The OCID of the compartment (remember that the tenancy is simply the root compartment).
- {[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 string
- The description you assign to the tag.
- {[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 string
- The OCID of the tag definition.
- isCost booleanTracking 
- 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 lifecycleStateis ACTIVE before using it. After retiring a tag, make sure itslifecycleStateis INACTIVE before using it. If you delete a tag, you cannot delete another tag until the deleted tag'slifecycleStatechanges from DELETING to DELETED.
- tagNamespace stringId 
- The OCID of the namespace that contains the tag definition.
- tagNamespace stringName 
- The name of the tag 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
GetCost Tracking Tags Tag Validator[] 
- 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.
- compartment_id str
- The OCID of the compartment (remember that the tenancy is simply the root compartment).
- 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 str
- The description you assign to the tag.
- 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 str
- The OCID of the tag definition.
- is_cost_ booltracking 
- 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 lifecycleStateis ACTIVE before using it. After retiring a tag, make sure itslifecycleStateis INACTIVE before using it. If you delete a tag, you cannot delete another tag until the deleted tag'slifecycleStatechanges from DELETING to DELETED.
- tag_namespace_ strid 
- The OCID of the namespace that contains the tag definition.
- tag_namespace_ strname 
- The name of the tag 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[GetCost Tracking Tags Tag Validator] 
- 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.
- compartmentId String
- The OCID of the compartment (remember that the tenancy is simply the root compartment).
- 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 String
- The description you assign to the tag.
- 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 String
- The OCID of the tag definition.
- isCost BooleanTracking 
- 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 lifecycleStateis ACTIVE before using it. After retiring a tag, make sure itslifecycleStateis INACTIVE before using it. If you delete a tag, you cannot delete another tag until the deleted tag'slifecycleStatechanges from DELETING to DELETED.
- tagNamespace StringId 
- The OCID of the namespace that contains the tag definition.
- tagNamespace StringName 
- The name of the tag 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.
GetCostTrackingTagsTagValidator     
- 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 ociTerraform Provider.