1. Packages
  2. Oracle Cloud Infrastructure
  3. API Docs
  4. MeteringComputation
  5. Usage
Oracle Cloud Infrastructure v1.32.0 published on Thursday, Apr 18, 2024 by Pulumi

oci.MeteringComputation.Usage

Explore with Pulumi AI

oci logo
Oracle Cloud Infrastructure v1.32.0 published on Thursday, Apr 18, 2024 by Pulumi

    This resource provides the Usage resource in Oracle Cloud Infrastructure Metering Computation service.

    Returns usage for the given account.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as oci from "@pulumi/oci";
    
    const testUsage = new oci.meteringcomputation.Usage("testUsage", {
        granularity: _var.usage_granularity,
        tenantId: oci_metering_computation_tenant.test_tenant.id,
        timeUsageEnded: _var.usage_time_usage_ended,
        timeUsageStarted: _var.usage_time_usage_started,
        compartmentDepth: _var.usage_compartment_depth,
        filter: _var.usage_filter,
        forecast: {
            timeForecastEnded: _var.usage_forecast_time_forecast_ended,
            forecastType: _var.usage_forecast_forecast_type,
            timeForecastStarted: _var.usage_forecast_time_forecast_started,
        },
        groupBies: _var.usage_group_by,
        groupByTags: [{
            key: _var.usage_group_by_tag_key,
            namespace: _var.usage_group_by_tag_namespace,
            value: _var.usage_group_by_tag_value,
        }],
        isAggregateByTime: _var.usage_is_aggregate_by_time,
        queryType: _var.usage_query_type,
    });
    
    import pulumi
    import pulumi_oci as oci
    
    test_usage = oci.metering_computation.Usage("testUsage",
        granularity=var["usage_granularity"],
        tenant_id=oci_metering_computation_tenant["test_tenant"]["id"],
        time_usage_ended=var["usage_time_usage_ended"],
        time_usage_started=var["usage_time_usage_started"],
        compartment_depth=var["usage_compartment_depth"],
        filter=var["usage_filter"],
        forecast=oci.metering_computation.UsageForecastArgs(
            time_forecast_ended=var["usage_forecast_time_forecast_ended"],
            forecast_type=var["usage_forecast_forecast_type"],
            time_forecast_started=var["usage_forecast_time_forecast_started"],
        ),
        group_bies=var["usage_group_by"],
        group_by_tags=[oci.metering_computation.UsageGroupByTagArgs(
            key=var["usage_group_by_tag_key"],
            namespace=var["usage_group_by_tag_namespace"],
            value=var["usage_group_by_tag_value"],
        )],
        is_aggregate_by_time=var["usage_is_aggregate_by_time"],
        query_type=var["usage_query_type"])
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-oci/sdk/go/oci/MeteringComputation"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := MeteringComputation.NewUsage(ctx, "testUsage", &MeteringComputation.UsageArgs{
    			Granularity:      pulumi.Any(_var.Usage_granularity),
    			TenantId:         pulumi.Any(oci_metering_computation_tenant.Test_tenant.Id),
    			TimeUsageEnded:   pulumi.Any(_var.Usage_time_usage_ended),
    			TimeUsageStarted: pulumi.Any(_var.Usage_time_usage_started),
    			CompartmentDepth: pulumi.Any(_var.Usage_compartment_depth),
    			Filter:           pulumi.Any(_var.Usage_filter),
    			Forecast: &meteringcomputation.UsageForecastArgs{
    				TimeForecastEnded:   pulumi.Any(_var.Usage_forecast_time_forecast_ended),
    				ForecastType:        pulumi.Any(_var.Usage_forecast_forecast_type),
    				TimeForecastStarted: pulumi.Any(_var.Usage_forecast_time_forecast_started),
    			},
    			GroupBies: pulumi.Any(_var.Usage_group_by),
    			GroupByTags: meteringcomputation.UsageGroupByTagArray{
    				&meteringcomputation.UsageGroupByTagArgs{
    					Key:       pulumi.Any(_var.Usage_group_by_tag_key),
    					Namespace: pulumi.Any(_var.Usage_group_by_tag_namespace),
    					Value:     pulumi.Any(_var.Usage_group_by_tag_value),
    				},
    			},
    			IsAggregateByTime: pulumi.Any(_var.Usage_is_aggregate_by_time),
    			QueryType:         pulumi.Any(_var.Usage_query_type),
    		})
    		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 testUsage = new Oci.MeteringComputation.Usage("testUsage", new()
        {
            Granularity = @var.Usage_granularity,
            TenantId = oci_metering_computation_tenant.Test_tenant.Id,
            TimeUsageEnded = @var.Usage_time_usage_ended,
            TimeUsageStarted = @var.Usage_time_usage_started,
            CompartmentDepth = @var.Usage_compartment_depth,
            Filter = @var.Usage_filter,
            Forecast = new Oci.MeteringComputation.Inputs.UsageForecastArgs
            {
                TimeForecastEnded = @var.Usage_forecast_time_forecast_ended,
                ForecastType = @var.Usage_forecast_forecast_type,
                TimeForecastStarted = @var.Usage_forecast_time_forecast_started,
            },
            GroupBies = @var.Usage_group_by,
            GroupByTags = new[]
            {
                new Oci.MeteringComputation.Inputs.UsageGroupByTagArgs
                {
                    Key = @var.Usage_group_by_tag_key,
                    Namespace = @var.Usage_group_by_tag_namespace,
                    Value = @var.Usage_group_by_tag_value,
                },
            },
            IsAggregateByTime = @var.Usage_is_aggregate_by_time,
            QueryType = @var.Usage_query_type,
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.oci.MeteringComputation.Usage;
    import com.pulumi.oci.MeteringComputation.UsageArgs;
    import com.pulumi.oci.MeteringComputation.inputs.UsageForecastArgs;
    import com.pulumi.oci.MeteringComputation.inputs.UsageGroupByTagArgs;
    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) {
            var testUsage = new Usage("testUsage", UsageArgs.builder()        
                .granularity(var_.usage_granularity())
                .tenantId(oci_metering_computation_tenant.test_tenant().id())
                .timeUsageEnded(var_.usage_time_usage_ended())
                .timeUsageStarted(var_.usage_time_usage_started())
                .compartmentDepth(var_.usage_compartment_depth())
                .filter(var_.usage_filter())
                .forecast(UsageForecastArgs.builder()
                    .timeForecastEnded(var_.usage_forecast_time_forecast_ended())
                    .forecastType(var_.usage_forecast_forecast_type())
                    .timeForecastStarted(var_.usage_forecast_time_forecast_started())
                    .build())
                .groupBies(var_.usage_group_by())
                .groupByTags(UsageGroupByTagArgs.builder()
                    .key(var_.usage_group_by_tag_key())
                    .namespace(var_.usage_group_by_tag_namespace())
                    .value(var_.usage_group_by_tag_value())
                    .build())
                .isAggregateByTime(var_.usage_is_aggregate_by_time())
                .queryType(var_.usage_query_type())
                .build());
    
        }
    }
    
    resources:
      testUsage:
        type: oci:MeteringComputation:Usage
        properties:
          #Required
          granularity: ${var.usage_granularity}
          tenantId: ${oci_metering_computation_tenant.test_tenant.id}
          timeUsageEnded: ${var.usage_time_usage_ended}
          timeUsageStarted: ${var.usage_time_usage_started}
          #Optional
          compartmentDepth: ${var.usage_compartment_depth}
          filter: ${var.usage_filter}
          forecast:
            timeForecastEnded: ${var.usage_forecast_time_forecast_ended}
            forecastType: ${var.usage_forecast_forecast_type}
            timeForecastStarted: ${var.usage_forecast_time_forecast_started}
          groupBies: ${var.usage_group_by}
          groupByTags:
            - key: ${var.usage_group_by_tag_key}
              namespace: ${var.usage_group_by_tag_namespace}
              value: ${var.usage_group_by_tag_value}
          isAggregateByTime: ${var.usage_is_aggregate_by_time}
          queryType: ${var.usage_query_type}
    

    Create Usage Resource

    Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.

    Constructor syntax

    new Usage(name: string, args: UsageArgs, opts?: CustomResourceOptions);
    @overload
    def Usage(resource_name: str,
              args: UsageArgs,
              opts: Optional[ResourceOptions] = None)
    
    @overload
    def Usage(resource_name: str,
              opts: Optional[ResourceOptions] = None,
              granularity: Optional[str] = None,
              tenant_id: Optional[str] = None,
              time_usage_ended: Optional[str] = None,
              time_usage_started: Optional[str] = None,
              compartment_depth: Optional[float] = None,
              filter: Optional[str] = None,
              forecast: Optional[_meteringcomputation.UsageForecastArgs] = None,
              group_bies: Optional[Sequence[str]] = None,
              group_by_tags: Optional[Sequence[_meteringcomputation.UsageGroupByTagArgs]] = None,
              is_aggregate_by_time: Optional[bool] = None,
              query_type: Optional[str] = None)
    func NewUsage(ctx *Context, name string, args UsageArgs, opts ...ResourceOption) (*Usage, error)
    public Usage(string name, UsageArgs args, CustomResourceOptions? opts = null)
    public Usage(String name, UsageArgs args)
    public Usage(String name, UsageArgs args, CustomResourceOptions options)
    
    type: oci:MeteringComputation:Usage
    properties: # The arguments to resource properties.
    options: # Bag of options to control resource's behavior.
    
    

    Parameters

    name string
    The unique name of the resource.
    args UsageArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    resource_name str
    The unique name of the resource.
    args UsageArgs
    The arguments to resource properties.
    opts ResourceOptions
    Bag of options to control resource's behavior.
    ctx Context
    Context object for the current deployment.
    name string
    The unique name of the resource.
    args UsageArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args UsageArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args UsageArgs
    The arguments to resource properties.
    options CustomResourceOptions
    Bag of options to control resource's behavior.

    Example

    The following reference example uses placeholder values for all input properties.

    var usageResource = new Oci.MeteringComputation.Usage("usageResource", new()
    {
        Granularity = "string",
        TenantId = "string",
        TimeUsageEnded = "string",
        TimeUsageStarted = "string",
        CompartmentDepth = 0,
        Filter = "string",
        Forecast = new Oci.MeteringComputation.Inputs.UsageForecastArgs
        {
            TimeForecastEnded = "string",
            ForecastType = "string",
            TimeForecastStarted = "string",
        },
        GroupBies = new[]
        {
            "string",
        },
        GroupByTags = new[]
        {
            new Oci.MeteringComputation.Inputs.UsageGroupByTagArgs
            {
                Key = "string",
                Namespace = "string",
                Value = "string",
            },
        },
        IsAggregateByTime = false,
        QueryType = "string",
    });
    
    example, err := MeteringComputation.NewUsage(ctx, "usageResource", &MeteringComputation.UsageArgs{
    	Granularity:      pulumi.String("string"),
    	TenantId:         pulumi.String("string"),
    	TimeUsageEnded:   pulumi.String("string"),
    	TimeUsageStarted: pulumi.String("string"),
    	CompartmentDepth: pulumi.Float64(0),
    	Filter:           pulumi.String("string"),
    	Forecast: &meteringcomputation.UsageForecastArgs{
    		TimeForecastEnded:   pulumi.String("string"),
    		ForecastType:        pulumi.String("string"),
    		TimeForecastStarted: pulumi.String("string"),
    	},
    	GroupBies: pulumi.StringArray{
    		pulumi.String("string"),
    	},
    	GroupByTags: meteringcomputation.UsageGroupByTagArray{
    		&meteringcomputation.UsageGroupByTagArgs{
    			Key:       pulumi.String("string"),
    			Namespace: pulumi.String("string"),
    			Value:     pulumi.String("string"),
    		},
    	},
    	IsAggregateByTime: pulumi.Bool(false),
    	QueryType:         pulumi.String("string"),
    })
    
    var usageResource = new Usage("usageResource", UsageArgs.builder()        
        .granularity("string")
        .tenantId("string")
        .timeUsageEnded("string")
        .timeUsageStarted("string")
        .compartmentDepth(0)
        .filter("string")
        .forecast(UsageForecastArgs.builder()
            .timeForecastEnded("string")
            .forecastType("string")
            .timeForecastStarted("string")
            .build())
        .groupBies("string")
        .groupByTags(UsageGroupByTagArgs.builder()
            .key("string")
            .namespace("string")
            .value("string")
            .build())
        .isAggregateByTime(false)
        .queryType("string")
        .build());
    
    usage_resource = oci.metering_computation.Usage("usageResource",
        granularity="string",
        tenant_id="string",
        time_usage_ended="string",
        time_usage_started="string",
        compartment_depth=0,
        filter="string",
        forecast=oci.metering_computation.UsageForecastArgs(
            time_forecast_ended="string",
            forecast_type="string",
            time_forecast_started="string",
        ),
        group_bies=["string"],
        group_by_tags=[oci.metering_computation.UsageGroupByTagArgs(
            key="string",
            namespace="string",
            value="string",
        )],
        is_aggregate_by_time=False,
        query_type="string")
    
    const usageResource = new oci.meteringcomputation.Usage("usageResource", {
        granularity: "string",
        tenantId: "string",
        timeUsageEnded: "string",
        timeUsageStarted: "string",
        compartmentDepth: 0,
        filter: "string",
        forecast: {
            timeForecastEnded: "string",
            forecastType: "string",
            timeForecastStarted: "string",
        },
        groupBies: ["string"],
        groupByTags: [{
            key: "string",
            namespace: "string",
            value: "string",
        }],
        isAggregateByTime: false,
        queryType: "string",
    });
    
    type: oci:MeteringComputation:Usage
    properties:
        compartmentDepth: 0
        filter: string
        forecast:
            forecastType: string
            timeForecastEnded: string
            timeForecastStarted: string
        granularity: string
        groupBies:
            - string
        groupByTags:
            - key: string
              namespace: string
              value: string
        isAggregateByTime: false
        queryType: string
        tenantId: string
        timeUsageEnded: string
        timeUsageStarted: string
    

    Usage Resource Properties

    To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.

    Inputs

    The Usage resource accepts the following input properties:

    Granularity string
    The usage granularity. HOURLY - Hourly data aggregation. DAILY - Daily data aggregation. MONTHLY - Monthly data aggregation. TOTAL - Not yet supported.
    TenantId string
    Tenant ID.
    TimeUsageEnded string
    The usage end time.
    TimeUsageStarted string

    The usage start time.

    ** IMPORTANT ** Any change to a property that does not support update will force the destruction and recreation of the resource with the new property values

    CompartmentDepth double
    The compartment depth level.
    Filter string
    The filter object for query usage.
    Forecast UsageForecast
    Forecast configuration of usage/cost.
    GroupBies List<string>
    Aggregate the result by. example: ["tagNamespace", "tagKey", "tagValue", "service", "skuName", "skuPartNumber", "unit", "compartmentName", "compartmentPath", "compartmentId", "platform", "region", "logicalAd", "resourceId", "tenantId", "tenantName"]
    GroupByTags List<UsageGroupByTag>
    GroupBy a specific tagKey. Provide the tagNamespace and tagKey in the tag object. Only supports one tag in the list. For example: [{"namespace":"oracle", "key":"createdBy"]
    IsAggregateByTime bool
    Whether aggregated by time. If isAggregateByTime is true, all usage/cost over the query time period will be added up.
    QueryType string
    The query usage type. COST by default if it is missing. Usage - Query the usage data. Cost - Query the cost/billing data. Credit - Query the credit adjustments data. ExpiredCredit - Query the expired credits data. AllCredit - Query the credit adjustments and expired credit.
    Granularity string
    The usage granularity. HOURLY - Hourly data aggregation. DAILY - Daily data aggregation. MONTHLY - Monthly data aggregation. TOTAL - Not yet supported.
    TenantId string
    Tenant ID.
    TimeUsageEnded string
    The usage end time.
    TimeUsageStarted string

    The usage start time.

    ** IMPORTANT ** Any change to a property that does not support update will force the destruction and recreation of the resource with the new property values

    CompartmentDepth float64
    The compartment depth level.
    Filter string
    The filter object for query usage.
    Forecast UsageForecastArgs
    Forecast configuration of usage/cost.
    GroupBies []string
    Aggregate the result by. example: ["tagNamespace", "tagKey", "tagValue", "service", "skuName", "skuPartNumber", "unit", "compartmentName", "compartmentPath", "compartmentId", "platform", "region", "logicalAd", "resourceId", "tenantId", "tenantName"]
    GroupByTags []UsageGroupByTagArgs
    GroupBy a specific tagKey. Provide the tagNamespace and tagKey in the tag object. Only supports one tag in the list. For example: [{"namespace":"oracle", "key":"createdBy"]
    IsAggregateByTime bool
    Whether aggregated by time. If isAggregateByTime is true, all usage/cost over the query time period will be added up.
    QueryType string
    The query usage type. COST by default if it is missing. Usage - Query the usage data. Cost - Query the cost/billing data. Credit - Query the credit adjustments data. ExpiredCredit - Query the expired credits data. AllCredit - Query the credit adjustments and expired credit.
    granularity String
    The usage granularity. HOURLY - Hourly data aggregation. DAILY - Daily data aggregation. MONTHLY - Monthly data aggregation. TOTAL - Not yet supported.
    tenantId String
    Tenant ID.
    timeUsageEnded String
    The usage end time.
    timeUsageStarted String

    The usage start time.

    ** IMPORTANT ** Any change to a property that does not support update will force the destruction and recreation of the resource with the new property values

    compartmentDepth Double
    The compartment depth level.
    filter String
    The filter object for query usage.
    forecast UsageForecast
    Forecast configuration of usage/cost.
    groupBies List<String>
    Aggregate the result by. example: ["tagNamespace", "tagKey", "tagValue", "service", "skuName", "skuPartNumber", "unit", "compartmentName", "compartmentPath", "compartmentId", "platform", "region", "logicalAd", "resourceId", "tenantId", "tenantName"]
    groupByTags List<UsageGroupByTag>
    GroupBy a specific tagKey. Provide the tagNamespace and tagKey in the tag object. Only supports one tag in the list. For example: [{"namespace":"oracle", "key":"createdBy"]
    isAggregateByTime Boolean
    Whether aggregated by time. If isAggregateByTime is true, all usage/cost over the query time period will be added up.
    queryType String
    The query usage type. COST by default if it is missing. Usage - Query the usage data. Cost - Query the cost/billing data. Credit - Query the credit adjustments data. ExpiredCredit - Query the expired credits data. AllCredit - Query the credit adjustments and expired credit.
    granularity string
    The usage granularity. HOURLY - Hourly data aggregation. DAILY - Daily data aggregation. MONTHLY - Monthly data aggregation. TOTAL - Not yet supported.
    tenantId string
    Tenant ID.
    timeUsageEnded string
    The usage end time.
    timeUsageStarted string

    The usage start time.

    ** IMPORTANT ** Any change to a property that does not support update will force the destruction and recreation of the resource with the new property values

    compartmentDepth number
    The compartment depth level.
    filter string
    The filter object for query usage.
    forecast UsageForecast
    Forecast configuration of usage/cost.
    groupBies string[]
    Aggregate the result by. example: ["tagNamespace", "tagKey", "tagValue", "service", "skuName", "skuPartNumber", "unit", "compartmentName", "compartmentPath", "compartmentId", "platform", "region", "logicalAd", "resourceId", "tenantId", "tenantName"]
    groupByTags UsageGroupByTag[]
    GroupBy a specific tagKey. Provide the tagNamespace and tagKey in the tag object. Only supports one tag in the list. For example: [{"namespace":"oracle", "key":"createdBy"]
    isAggregateByTime boolean
    Whether aggregated by time. If isAggregateByTime is true, all usage/cost over the query time period will be added up.
    queryType string
    The query usage type. COST by default if it is missing. Usage - Query the usage data. Cost - Query the cost/billing data. Credit - Query the credit adjustments data. ExpiredCredit - Query the expired credits data. AllCredit - Query the credit adjustments and expired credit.
    granularity str
    The usage granularity. HOURLY - Hourly data aggregation. DAILY - Daily data aggregation. MONTHLY - Monthly data aggregation. TOTAL - Not yet supported.
    tenant_id str
    Tenant ID.
    time_usage_ended str
    The usage end time.
    time_usage_started str

    The usage start time.

    ** IMPORTANT ** Any change to a property that does not support update will force the destruction and recreation of the resource with the new property values

    compartment_depth float
    The compartment depth level.
    filter str
    The filter object for query usage.
    forecast meteringcomputation.UsageForecastArgs
    Forecast configuration of usage/cost.
    group_bies Sequence[str]
    Aggregate the result by. example: ["tagNamespace", "tagKey", "tagValue", "service", "skuName", "skuPartNumber", "unit", "compartmentName", "compartmentPath", "compartmentId", "platform", "region", "logicalAd", "resourceId", "tenantId", "tenantName"]
    group_by_tags Sequence[meteringcomputation.UsageGroupByTagArgs]
    GroupBy a specific tagKey. Provide the tagNamespace and tagKey in the tag object. Only supports one tag in the list. For example: [{"namespace":"oracle", "key":"createdBy"]
    is_aggregate_by_time bool
    Whether aggregated by time. If isAggregateByTime is true, all usage/cost over the query time period will be added up.
    query_type str
    The query usage type. COST by default if it is missing. Usage - Query the usage data. Cost - Query the cost/billing data. Credit - Query the credit adjustments data. ExpiredCredit - Query the expired credits data. AllCredit - Query the credit adjustments and expired credit.
    granularity String
    The usage granularity. HOURLY - Hourly data aggregation. DAILY - Daily data aggregation. MONTHLY - Monthly data aggregation. TOTAL - Not yet supported.
    tenantId String
    Tenant ID.
    timeUsageEnded String
    The usage end time.
    timeUsageStarted String

    The usage start time.

    ** IMPORTANT ** Any change to a property that does not support update will force the destruction and recreation of the resource with the new property values

    compartmentDepth Number
    The compartment depth level.
    filter String
    The filter object for query usage.
    forecast Property Map
    Forecast configuration of usage/cost.
    groupBies List<String>
    Aggregate the result by. example: ["tagNamespace", "tagKey", "tagValue", "service", "skuName", "skuPartNumber", "unit", "compartmentName", "compartmentPath", "compartmentId", "platform", "region", "logicalAd", "resourceId", "tenantId", "tenantName"]
    groupByTags List<Property Map>
    GroupBy a specific tagKey. Provide the tagNamespace and tagKey in the tag object. Only supports one tag in the list. For example: [{"namespace":"oracle", "key":"createdBy"]
    isAggregateByTime Boolean
    Whether aggregated by time. If isAggregateByTime is true, all usage/cost over the query time period will be added up.
    queryType String
    The query usage type. COST by default if it is missing. Usage - Query the usage data. Cost - Query the cost/billing data. Credit - Query the credit adjustments data. ExpiredCredit - Query the expired credits data. AllCredit - Query the credit adjustments and expired credit.

    Outputs

    All input properties are implicitly available as output properties. Additionally, the Usage resource produces the following output properties:

    Id string
    The provider-assigned unique ID for this managed resource.
    Items List<UsageItem>
    A list of usage items.
    Id string
    The provider-assigned unique ID for this managed resource.
    Items []UsageItem
    A list of usage items.
    id String
    The provider-assigned unique ID for this managed resource.
    items List<UsageItem>
    A list of usage items.
    id string
    The provider-assigned unique ID for this managed resource.
    items UsageItem[]
    A list of usage items.
    id str
    The provider-assigned unique ID for this managed resource.
    items Sequence[meteringcomputation.UsageItem]
    A list of usage items.
    id String
    The provider-assigned unique ID for this managed resource.
    items List<Property Map>
    A list of usage items.

    Look up Existing Usage Resource

    Get an existing Usage resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.

    public static get(name: string, id: Input<ID>, state?: UsageState, opts?: CustomResourceOptions): Usage
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            compartment_depth: Optional[float] = None,
            filter: Optional[str] = None,
            forecast: Optional[_meteringcomputation.UsageForecastArgs] = None,
            granularity: Optional[str] = None,
            group_bies: Optional[Sequence[str]] = None,
            group_by_tags: Optional[Sequence[_meteringcomputation.UsageGroupByTagArgs]] = None,
            is_aggregate_by_time: Optional[bool] = None,
            items: Optional[Sequence[_meteringcomputation.UsageItemArgs]] = None,
            query_type: Optional[str] = None,
            tenant_id: Optional[str] = None,
            time_usage_ended: Optional[str] = None,
            time_usage_started: Optional[str] = None) -> Usage
    func GetUsage(ctx *Context, name string, id IDInput, state *UsageState, opts ...ResourceOption) (*Usage, error)
    public static Usage Get(string name, Input<string> id, UsageState? state, CustomResourceOptions? opts = null)
    public static Usage get(String name, Output<String> id, UsageState state, CustomResourceOptions options)
    Resource lookup is not supported in YAML
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    resource_name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    The following state arguments are supported:
    CompartmentDepth double
    The compartment depth level.
    Filter string
    The filter object for query usage.
    Forecast UsageForecast
    Forecast configuration of usage/cost.
    Granularity string
    The usage granularity. HOURLY - Hourly data aggregation. DAILY - Daily data aggregation. MONTHLY - Monthly data aggregation. TOTAL - Not yet supported.
    GroupBies List<string>
    Aggregate the result by. example: ["tagNamespace", "tagKey", "tagValue", "service", "skuName", "skuPartNumber", "unit", "compartmentName", "compartmentPath", "compartmentId", "platform", "region", "logicalAd", "resourceId", "tenantId", "tenantName"]
    GroupByTags List<UsageGroupByTag>
    GroupBy a specific tagKey. Provide the tagNamespace and tagKey in the tag object. Only supports one tag in the list. For example: [{"namespace":"oracle", "key":"createdBy"]
    IsAggregateByTime bool
    Whether aggregated by time. If isAggregateByTime is true, all usage/cost over the query time period will be added up.
    Items List<UsageItem>
    A list of usage items.
    QueryType string
    The query usage type. COST by default if it is missing. Usage - Query the usage data. Cost - Query the cost/billing data. Credit - Query the credit adjustments data. ExpiredCredit - Query the expired credits data. AllCredit - Query the credit adjustments and expired credit.
    TenantId string
    Tenant ID.
    TimeUsageEnded string
    The usage end time.
    TimeUsageStarted string

    The usage start time.

    ** IMPORTANT ** Any change to a property that does not support update will force the destruction and recreation of the resource with the new property values

    CompartmentDepth float64
    The compartment depth level.
    Filter string
    The filter object for query usage.
    Forecast UsageForecastArgs
    Forecast configuration of usage/cost.
    Granularity string
    The usage granularity. HOURLY - Hourly data aggregation. DAILY - Daily data aggregation. MONTHLY - Monthly data aggregation. TOTAL - Not yet supported.
    GroupBies []string
    Aggregate the result by. example: ["tagNamespace", "tagKey", "tagValue", "service", "skuName", "skuPartNumber", "unit", "compartmentName", "compartmentPath", "compartmentId", "platform", "region", "logicalAd", "resourceId", "tenantId", "tenantName"]
    GroupByTags []UsageGroupByTagArgs
    GroupBy a specific tagKey. Provide the tagNamespace and tagKey in the tag object. Only supports one tag in the list. For example: [{"namespace":"oracle", "key":"createdBy"]
    IsAggregateByTime bool
    Whether aggregated by time. If isAggregateByTime is true, all usage/cost over the query time period will be added up.
    Items []UsageItemArgs
    A list of usage items.
    QueryType string
    The query usage type. COST by default if it is missing. Usage - Query the usage data. Cost - Query the cost/billing data. Credit - Query the credit adjustments data. ExpiredCredit - Query the expired credits data. AllCredit - Query the credit adjustments and expired credit.
    TenantId string
    Tenant ID.
    TimeUsageEnded string
    The usage end time.
    TimeUsageStarted string

    The usage start time.

    ** IMPORTANT ** Any change to a property that does not support update will force the destruction and recreation of the resource with the new property values

    compartmentDepth Double
    The compartment depth level.
    filter String
    The filter object for query usage.
    forecast UsageForecast
    Forecast configuration of usage/cost.
    granularity String
    The usage granularity. HOURLY - Hourly data aggregation. DAILY - Daily data aggregation. MONTHLY - Monthly data aggregation. TOTAL - Not yet supported.
    groupBies List<String>
    Aggregate the result by. example: ["tagNamespace", "tagKey", "tagValue", "service", "skuName", "skuPartNumber", "unit", "compartmentName", "compartmentPath", "compartmentId", "platform", "region", "logicalAd", "resourceId", "tenantId", "tenantName"]
    groupByTags List<UsageGroupByTag>
    GroupBy a specific tagKey. Provide the tagNamespace and tagKey in the tag object. Only supports one tag in the list. For example: [{"namespace":"oracle", "key":"createdBy"]
    isAggregateByTime Boolean
    Whether aggregated by time. If isAggregateByTime is true, all usage/cost over the query time period will be added up.
    items List<UsageItem>
    A list of usage items.
    queryType String
    The query usage type. COST by default if it is missing. Usage - Query the usage data. Cost - Query the cost/billing data. Credit - Query the credit adjustments data. ExpiredCredit - Query the expired credits data. AllCredit - Query the credit adjustments and expired credit.
    tenantId String
    Tenant ID.
    timeUsageEnded String
    The usage end time.
    timeUsageStarted String

    The usage start time.

    ** IMPORTANT ** Any change to a property that does not support update will force the destruction and recreation of the resource with the new property values

    compartmentDepth number
    The compartment depth level.
    filter string
    The filter object for query usage.
    forecast UsageForecast
    Forecast configuration of usage/cost.
    granularity string
    The usage granularity. HOURLY - Hourly data aggregation. DAILY - Daily data aggregation. MONTHLY - Monthly data aggregation. TOTAL - Not yet supported.
    groupBies string[]
    Aggregate the result by. example: ["tagNamespace", "tagKey", "tagValue", "service", "skuName", "skuPartNumber", "unit", "compartmentName", "compartmentPath", "compartmentId", "platform", "region", "logicalAd", "resourceId", "tenantId", "tenantName"]
    groupByTags UsageGroupByTag[]
    GroupBy a specific tagKey. Provide the tagNamespace and tagKey in the tag object. Only supports one tag in the list. For example: [{"namespace":"oracle", "key":"createdBy"]
    isAggregateByTime boolean
    Whether aggregated by time. If isAggregateByTime is true, all usage/cost over the query time period will be added up.
    items UsageItem[]
    A list of usage items.
    queryType string
    The query usage type. COST by default if it is missing. Usage - Query the usage data. Cost - Query the cost/billing data. Credit - Query the credit adjustments data. ExpiredCredit - Query the expired credits data. AllCredit - Query the credit adjustments and expired credit.
    tenantId string
    Tenant ID.
    timeUsageEnded string
    The usage end time.
    timeUsageStarted string

    The usage start time.

    ** IMPORTANT ** Any change to a property that does not support update will force the destruction and recreation of the resource with the new property values

    compartment_depth float
    The compartment depth level.
    filter str
    The filter object for query usage.
    forecast meteringcomputation.UsageForecastArgs
    Forecast configuration of usage/cost.
    granularity str
    The usage granularity. HOURLY - Hourly data aggregation. DAILY - Daily data aggregation. MONTHLY - Monthly data aggregation. TOTAL - Not yet supported.
    group_bies Sequence[str]
    Aggregate the result by. example: ["tagNamespace", "tagKey", "tagValue", "service", "skuName", "skuPartNumber", "unit", "compartmentName", "compartmentPath", "compartmentId", "platform", "region", "logicalAd", "resourceId", "tenantId", "tenantName"]
    group_by_tags Sequence[meteringcomputation.UsageGroupByTagArgs]
    GroupBy a specific tagKey. Provide the tagNamespace and tagKey in the tag object. Only supports one tag in the list. For example: [{"namespace":"oracle", "key":"createdBy"]
    is_aggregate_by_time bool
    Whether aggregated by time. If isAggregateByTime is true, all usage/cost over the query time period will be added up.
    items Sequence[meteringcomputation.UsageItemArgs]
    A list of usage items.
    query_type str
    The query usage type. COST by default if it is missing. Usage - Query the usage data. Cost - Query the cost/billing data. Credit - Query the credit adjustments data. ExpiredCredit - Query the expired credits data. AllCredit - Query the credit adjustments and expired credit.
    tenant_id str
    Tenant ID.
    time_usage_ended str
    The usage end time.
    time_usage_started str

    The usage start time.

    ** IMPORTANT ** Any change to a property that does not support update will force the destruction and recreation of the resource with the new property values

    compartmentDepth Number
    The compartment depth level.
    filter String
    The filter object for query usage.
    forecast Property Map
    Forecast configuration of usage/cost.
    granularity String
    The usage granularity. HOURLY - Hourly data aggregation. DAILY - Daily data aggregation. MONTHLY - Monthly data aggregation. TOTAL - Not yet supported.
    groupBies List<String>
    Aggregate the result by. example: ["tagNamespace", "tagKey", "tagValue", "service", "skuName", "skuPartNumber", "unit", "compartmentName", "compartmentPath", "compartmentId", "platform", "region", "logicalAd", "resourceId", "tenantId", "tenantName"]
    groupByTags List<Property Map>
    GroupBy a specific tagKey. Provide the tagNamespace and tagKey in the tag object. Only supports one tag in the list. For example: [{"namespace":"oracle", "key":"createdBy"]
    isAggregateByTime Boolean
    Whether aggregated by time. If isAggregateByTime is true, all usage/cost over the query time period will be added up.
    items List<Property Map>
    A list of usage items.
    queryType String
    The query usage type. COST by default if it is missing. Usage - Query the usage data. Cost - Query the cost/billing data. Credit - Query the credit adjustments data. ExpiredCredit - Query the expired credits data. AllCredit - Query the credit adjustments and expired credit.
    tenantId String
    Tenant ID.
    timeUsageEnded String
    The usage end time.
    timeUsageStarted String

    The usage start time.

    ** IMPORTANT ** Any change to a property that does not support update will force the destruction and recreation of the resource with the new property values

    Supporting Types

    UsageForecast, UsageForecastArgs

    TimeForecastEnded string
    The forecast end time.
    ForecastType string
    BASIC uses the exponential smoothing (ETS) model to project future usage/costs based on history data. The basis for projections is a periodic set of equivalent historical days for which the projection is being made.
    TimeForecastStarted string
    The forecast start time. Defaults to UTC-1 if not specified.
    TimeForecastEnded string
    The forecast end time.
    ForecastType string
    BASIC uses the exponential smoothing (ETS) model to project future usage/costs based on history data. The basis for projections is a periodic set of equivalent historical days for which the projection is being made.
    TimeForecastStarted string
    The forecast start time. Defaults to UTC-1 if not specified.
    timeForecastEnded String
    The forecast end time.
    forecastType String
    BASIC uses the exponential smoothing (ETS) model to project future usage/costs based on history data. The basis for projections is a periodic set of equivalent historical days for which the projection is being made.
    timeForecastStarted String
    The forecast start time. Defaults to UTC-1 if not specified.
    timeForecastEnded string
    The forecast end time.
    forecastType string
    BASIC uses the exponential smoothing (ETS) model to project future usage/costs based on history data. The basis for projections is a periodic set of equivalent historical days for which the projection is being made.
    timeForecastStarted string
    The forecast start time. Defaults to UTC-1 if not specified.
    time_forecast_ended str
    The forecast end time.
    forecast_type str
    BASIC uses the exponential smoothing (ETS) model to project future usage/costs based on history data. The basis for projections is a periodic set of equivalent historical days for which the projection is being made.
    time_forecast_started str
    The forecast start time. Defaults to UTC-1 if not specified.
    timeForecastEnded String
    The forecast end time.
    forecastType String
    BASIC uses the exponential smoothing (ETS) model to project future usage/costs based on history data. The basis for projections is a periodic set of equivalent historical days for which the projection is being made.
    timeForecastStarted String
    The forecast start time. Defaults to UTC-1 if not specified.

    UsageGroupByTag, UsageGroupByTagArgs

    Key string
    The tag key.
    Namespace string
    The tag namespace.
    Value string
    The tag value.
    Key string
    The tag key.
    Namespace string
    The tag namespace.
    Value string
    The tag value.
    key String
    The tag key.
    namespace String
    The tag namespace.
    value String
    The tag value.
    key string
    The tag key.
    namespace string
    The tag namespace.
    value string
    The tag value.
    key str
    The tag key.
    namespace str
    The tag namespace.
    value str
    The tag value.
    key String
    The tag key.
    namespace String
    The tag namespace.
    value String
    The tag value.

    UsageItem, UsageItemArgs

    Ad string
    The availability domain of the usage.
    CompartmentId string
    The compartment OCID.
    CompartmentName string
    The compartment name.
    CompartmentPath string
    The compartment path, starting from root.
    ComputedAmount double
    The computed cost.
    ComputedQuantity double
    The usage number.
    Currency string
    The price currency.
    Discount double
    The discretionary discount applied to the SKU.
    IsForecast bool
    The forecasted data.
    ListRate double
    The SKU list rate (not discount).
    Overage string
    The overage usage.
    OveragesFlag string
    The SPM OverageFlag.
    Platform string
    Platform for the cost.
    Region string
    The region of the usage.
    ResourceId string
    The resource OCID that is incurring the cost.
    ResourceName string
    The resource name that is incurring the cost.
    Service string
    The service name that is incurring the cost.
    Shape string
    The resource shape.
    SkuName string
    The SKU friendly name.
    SkuPartNumber string
    The SKU part number.
    SubscriptionId string
    The subscription ID.
    Tags List<UsageItemTag>
    For grouping, a tag definition. For filtering, a definition and key.
    TenantId string
    Tenant ID.
    TenantName string
    The tenancy name.
    TimeUsageEnded string
    The usage end time.
    TimeUsageStarted string

    The usage start time.

    ** IMPORTANT ** Any change to a property that does not support update will force the destruction and recreation of the resource with the new property values

    Unit string
    The usage unit.
    UnitPrice double
    The price per unit.
    Weight double
    The resource size being metered.
    Ad string
    The availability domain of the usage.
    CompartmentId string
    The compartment OCID.
    CompartmentName string
    The compartment name.
    CompartmentPath string
    The compartment path, starting from root.
    ComputedAmount float64
    The computed cost.
    ComputedQuantity float64
    The usage number.
    Currency string
    The price currency.
    Discount float64
    The discretionary discount applied to the SKU.
    IsForecast bool
    The forecasted data.
    ListRate float64
    The SKU list rate (not discount).
    Overage string
    The overage usage.
    OveragesFlag string
    The SPM OverageFlag.
    Platform string
    Platform for the cost.
    Region string
    The region of the usage.
    ResourceId string
    The resource OCID that is incurring the cost.
    ResourceName string
    The resource name that is incurring the cost.
    Service string
    The service name that is incurring the cost.
    Shape string
    The resource shape.
    SkuName string
    The SKU friendly name.
    SkuPartNumber string
    The SKU part number.
    SubscriptionId string
    The subscription ID.
    Tags []UsageItemTag
    For grouping, a tag definition. For filtering, a definition and key.
    TenantId string
    Tenant ID.
    TenantName string
    The tenancy name.
    TimeUsageEnded string
    The usage end time.
    TimeUsageStarted string

    The usage start time.

    ** IMPORTANT ** Any change to a property that does not support update will force the destruction and recreation of the resource with the new property values

    Unit string
    The usage unit.
    UnitPrice float64
    The price per unit.
    Weight float64
    The resource size being metered.
    ad String
    The availability domain of the usage.
    compartmentId String
    The compartment OCID.
    compartmentName String
    The compartment name.
    compartmentPath String
    The compartment path, starting from root.
    computedAmount Double
    The computed cost.
    computedQuantity Double
    The usage number.
    currency String
    The price currency.
    discount Double
    The discretionary discount applied to the SKU.
    isForecast Boolean
    The forecasted data.
    listRate Double
    The SKU list rate (not discount).
    overage String
    The overage usage.
    overagesFlag String
    The SPM OverageFlag.
    platform String
    Platform for the cost.
    region String
    The region of the usage.
    resourceId String
    The resource OCID that is incurring the cost.
    resourceName String
    The resource name that is incurring the cost.
    service String
    The service name that is incurring the cost.
    shape String
    The resource shape.
    skuName String
    The SKU friendly name.
    skuPartNumber String
    The SKU part number.
    subscriptionId String
    The subscription ID.
    tags List<UsageItemTag>
    For grouping, a tag definition. For filtering, a definition and key.
    tenantId String
    Tenant ID.
    tenantName String
    The tenancy name.
    timeUsageEnded String
    The usage end time.
    timeUsageStarted String

    The usage start time.

    ** IMPORTANT ** Any change to a property that does not support update will force the destruction and recreation of the resource with the new property values

    unit String
    The usage unit.
    unitPrice Double
    The price per unit.
    weight Double
    The resource size being metered.
    ad string
    The availability domain of the usage.
    compartmentId string
    The compartment OCID.
    compartmentName string
    The compartment name.
    compartmentPath string
    The compartment path, starting from root.
    computedAmount number
    The computed cost.
    computedQuantity number
    The usage number.
    currency string
    The price currency.
    discount number
    The discretionary discount applied to the SKU.
    isForecast boolean
    The forecasted data.
    listRate number
    The SKU list rate (not discount).
    overage string
    The overage usage.
    overagesFlag string
    The SPM OverageFlag.
    platform string
    Platform for the cost.
    region string
    The region of the usage.
    resourceId string
    The resource OCID that is incurring the cost.
    resourceName string
    The resource name that is incurring the cost.
    service string
    The service name that is incurring the cost.
    shape string
    The resource shape.
    skuName string
    The SKU friendly name.
    skuPartNumber string
    The SKU part number.
    subscriptionId string
    The subscription ID.
    tags UsageItemTag[]
    For grouping, a tag definition. For filtering, a definition and key.
    tenantId string
    Tenant ID.
    tenantName string
    The tenancy name.
    timeUsageEnded string
    The usage end time.
    timeUsageStarted string

    The usage start time.

    ** IMPORTANT ** Any change to a property that does not support update will force the destruction and recreation of the resource with the new property values

    unit string
    The usage unit.
    unitPrice number
    The price per unit.
    weight number
    The resource size being metered.
    ad str
    The availability domain of the usage.
    compartment_id str
    The compartment OCID.
    compartment_name str
    The compartment name.
    compartment_path str
    The compartment path, starting from root.
    computed_amount float
    The computed cost.
    computed_quantity float
    The usage number.
    currency str
    The price currency.
    discount float
    The discretionary discount applied to the SKU.
    is_forecast bool
    The forecasted data.
    list_rate float
    The SKU list rate (not discount).
    overage str
    The overage usage.
    overages_flag str
    The SPM OverageFlag.
    platform str
    Platform for the cost.
    region str
    The region of the usage.
    resource_id str
    The resource OCID that is incurring the cost.
    resource_name str
    The resource name that is incurring the cost.
    service str
    The service name that is incurring the cost.
    shape str
    The resource shape.
    sku_name str
    The SKU friendly name.
    sku_part_number str
    The SKU part number.
    subscription_id str
    The subscription ID.
    tags Sequence[meteringcomputation.UsageItemTag]
    For grouping, a tag definition. For filtering, a definition and key.
    tenant_id str
    Tenant ID.
    tenant_name str
    The tenancy name.
    time_usage_ended str
    The usage end time.
    time_usage_started str

    The usage start time.

    ** IMPORTANT ** Any change to a property that does not support update will force the destruction and recreation of the resource with the new property values

    unit str
    The usage unit.
    unit_price float
    The price per unit.
    weight float
    The resource size being metered.
    ad String
    The availability domain of the usage.
    compartmentId String
    The compartment OCID.
    compartmentName String
    The compartment name.
    compartmentPath String
    The compartment path, starting from root.
    computedAmount Number
    The computed cost.
    computedQuantity Number
    The usage number.
    currency String
    The price currency.
    discount Number
    The discretionary discount applied to the SKU.
    isForecast Boolean
    The forecasted data.
    listRate Number
    The SKU list rate (not discount).
    overage String
    The overage usage.
    overagesFlag String
    The SPM OverageFlag.
    platform String
    Platform for the cost.
    region String
    The region of the usage.
    resourceId String
    The resource OCID that is incurring the cost.
    resourceName String
    The resource name that is incurring the cost.
    service String
    The service name that is incurring the cost.
    shape String
    The resource shape.
    skuName String
    The SKU friendly name.
    skuPartNumber String
    The SKU part number.
    subscriptionId String
    The subscription ID.
    tags List<Property Map>
    For grouping, a tag definition. For filtering, a definition and key.
    tenantId String
    Tenant ID.
    tenantName String
    The tenancy name.
    timeUsageEnded String
    The usage end time.
    timeUsageStarted String

    The usage start time.

    ** IMPORTANT ** Any change to a property that does not support update will force the destruction and recreation of the resource with the new property values

    unit String
    The usage unit.
    unitPrice Number
    The price per unit.
    weight Number
    The resource size being metered.

    UsageItemTag, UsageItemTagArgs

    Key string
    The tag key.
    Namespace string
    The tag namespace.
    Value string
    The tag value.
    Key string
    The tag key.
    Namespace string
    The tag namespace.
    Value string
    The tag value.
    key String
    The tag key.
    namespace String
    The tag namespace.
    value String
    The tag value.
    key string
    The tag key.
    namespace string
    The tag namespace.
    value string
    The tag value.
    key str
    The tag key.
    namespace str
    The tag namespace.
    value str
    The tag value.
    key String
    The tag key.
    namespace String
    The tag namespace.
    value String
    The tag value.

    Import

    Import is not supported for this resource.

    To learn more about importing existing cloud resources, see Importing resources.

    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 v1.32.0 published on Thursday, Apr 18, 2024 by Pulumi