oci_budget_budget
This resource provides the Budget resource in Oracle Cloud Infrastructure Budget service.
Creates a new budget.
Example Usage
resource "oci_budget_budget" "test_budget" {
#Required
amount = var.budget_amount
compartment_id = var.tenancy_ocid
reset_period = var.budget_reset_period
#Optional
budget_processing_period_start_offset = var.budget_budget_processing_period_start_offset
defined_tags = {"Operations.CostCenter"= "42"}
description = var.budget_description
display_name = var.budget_display_name
end_date = var.budget_end_date
freeform_tags = {"Department"= "Finance"}
processing_period_type = var.budget_processing_period_type
start_date = var.budget_start_date
target_compartment_id = oci_identity_compartment.test_compartment.id
target_type = var.budget_target_type
targets = var.budget_targets
}
Argument Reference
The following arguments are supported:
amount
- (Required) (Updatable) The amount of the budget expressed as a whole number in the currency of the customer’s rate card.budget_processing_period_start_offset
- (Optional) (Updatable) The number of days offset from the first day of the month, at which the budget processing period starts. In months that have fewer days than this value, processing will begin on the last day of that month. For example, for a value of 12, processing starts every month on the 12th at midnight.compartment_id
- (Required) The OCID of the compartment.defined_tags
- (Optional) (Updatable) 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
- (Optional) (Updatable) The description of the budget.display_name
- (Optional) (Updatable) The displayName of the budget. Avoid entering confidential information.end_date
- (Optional) (Updatable) The date when the one-time budget concludes. For example,2023-03-23
. The date-time format conforms to RFC 3339, and will be truncated to the starting point of the date provided after being converted to UTC time.freeform_tags
- (Optional) (Updatable) 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"}
processing_period_type
- (Optional) (Updatable) The type of the budget processing period. Valid values are INVOICE, MONTH, and SINGLE_USE.reset_period
- (Required) (Updatable) The reset period for the budget. Valid value is MONTHLY.start_date
- (Optional) (Updatable) The date when the one-time budget begins. For example,2023-03-23
. The date-time format conforms to RFC 3339, and will be truncated to the starting point of the date provided after being converted to UTC time.target_compartment_id
- (Optional) This is DEPRECATED. Set the target compartment ID in targets instead.target_type
- (Optional) The type of target on which the budget is applied.targets
- (Optional) The list of targets on which the budget is applied. If targetType is “COMPARTMENT”, the targets contain the list of compartment OCIDs. If targetType is “TAG”, the targets contain the list of cost tracking tag identifiers in the form of “{tagNamespace}.{tagKey}.{tagValue}”. Curerntly, the array should contain exactly one item.
** 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:
actual_spend
- The actual spend in currency for the current budget cycle.alert_rule_count
- The total number of alert rules in the budget.amount
- The amount of the budget, expressed in the currency of the customer’s rate card.budget_processing_period_start_offset
- The number of days offset from the first day of the month, at which the budget processing period starts. In months that have fewer days than this value, processing will begin on the last day of that month. For example, for a value of 12, processing starts every month on the 12th at midnight.compartment_id
- The OCID of the compartment.defined_tags
- 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
- The description of the budget.display_name
- The display name of the budget. Avoid entering confidential information.end_date
- The time when the one-time budget concludes. For example, -2023-03-23
. The date-time format conforms to RFC 3339, and will be truncated to the starting point of the date provided after being converted to UTC time.forecasted_spend
- The forecasted spend in currency by the end of the current budget cycle.freeform_tags
- 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
- The OCID of the budget.processing_period_type
- The type of the budget processing period. Valid values are INVOICE, MONTH, and SINGLE_USE.reset_period
- The reset period for the budget.start_date
- The date when the one-time budget begins. For example,2023-03-23
. The date-time format conforms to RFC 3339, and will be truncated to the starting point of the date provided after being converted to UTC time.state
- The current state of the budget.target_compartment_id
- This is DEPRECATED. For backwards compatability, the property is populated when the targetType is “COMPARTMENT”, and targets contain the specific target compartment OCID. For all other scenarios, this property will be left empty.target_type
- The type of target on which the budget is applied.targets
- The list of targets on which the budget is applied. If the targetType is “COMPARTMENT”, the targets contain the list of compartment OCIDs. If the targetType is “TAG”, the targets contain the list of cost tracking tag identifiers in the form of “{tagNamespace}.{tagKey}.{tagValue}”.time_created
- The time that the budget was created.time_spend_computed
- The time that the budget spend was last computed.time_updated
- The time that the budget was updated.version
- The version of the budget. Starts from 1 and increments by 1.
Timeouts
The timeouts
block allows you to specify timeouts for certain operations:
* create
- (Defaults to 20 minutes), when creating the Budget
* update
- (Defaults to 20 minutes), when updating the Budget
* delete
- (Defaults to 20 minutes), when destroying the Budget
Import
Budgets can be imported using the id
, e.g.
$ terraform import oci_budget_budget.test_budget "id"