oci_metering_computation_query

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

Returns the created query.

Example Usage

resource "oci_metering_computation_query" "test_query" {
	#Required
	compartment_id = var.compartment_id
	query_definition {
		#Required
		cost_analysis_ui {

			#Optional
			graph = var.query_query_definition_cost_analysis_ui_graph
			is_cumulative_graph = var.query_query_definition_cost_analysis_ui_is_cumulative_graph
		}
		display_name = var.query_query_definition_display_name
		report_query {
			#Required
			granularity = var.query_query_definition_report_query_granularity
			tenant_id = oci_metering_computation_tenant.test_tenant.id

			#Optional
			compartment_depth = var.query_query_definition_report_query_compartment_depth
			date_range_name = var.query_query_definition_report_query_date_range_name
			filter = var.query_query_definition_report_query_filter
			forecast {
				#Required
				time_forecast_ended = var.query_query_definition_report_query_forecast_time_forecast_ended

				#Optional
				forecast_type = var.query_query_definition_report_query_forecast_forecast_type
				time_forecast_started = var.query_query_definition_report_query_forecast_time_forecast_started
			}
			group_by = var.query_query_definition_report_query_group_by
			group_by_tag {

				#Optional
				key = var.query_query_definition_report_query_group_by_tag_key
				namespace = var.query_query_definition_report_query_group_by_tag_namespace
				value = var.query_query_definition_report_query_group_by_tag_value
			}
			is_aggregate_by_time = var.query_query_definition_report_query_is_aggregate_by_time
			query_type = var.query_query_definition_report_query_query_type
			time_usage_ended = var.query_query_definition_report_query_time_usage_ended
			time_usage_started = var.query_query_definition_report_query_time_usage_started
		}
		version = var.query_query_definition_version
	}
}

Argument Reference

The following arguments are supported:

** 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

Attributes Reference

The following attributes are exported:

Timeouts

The timeouts block allows you to specify timeouts for certain operations: * create - (Defaults to 20 minutes), when creating the Query * update - (Defaults to 20 minutes), when updating the Query * delete - (Defaults to 20 minutes), when destroying the Query

Import

Queries can be imported using the id, e.g.

$ terraform import oci_metering_computation_query.test_query "id"