Resource
dcloud_budget
A cost budget for a period, over the organization, one project or a tag query, emailing at the alert thresholds (percent of the amount).
Example Usage
resource "dcloud_budget" "payments" {
name = "Payments monthly"
amount_cents = 250000
period = "monthly"
scope = jsonencode({ type = "project", projectId = dcloud_project.payments_prod.id })
alert_thresholds = [80, 100]
notification_emails = ["payments-leads@example.com"]
}Schema
Required
amount_cents(Number) The budget, euro cents.name(String) 1–255 characters; need not be unique. Up to 255 characters.period(String) monthly, quarterly or annual; required here (the console’s form starts at monthly). Periods start at midnight German time, like the invoice One of:monthly,quarterly,annual.
Optional
action(String) Let the budget propose stopping non-production resources (JSON):{ thresholdPercent = 100, selector = [{ key = "environment", values = ["dev", "test"] }] }. A person approves each proposal in the console or API; nothing stops on its own. Omit for alerts only. Usejsonencode.alert_thresholds(List of String) Percentages of the amount that send an alert, e.g.[80, 100](the default).forecast_thresholds(List of String) Monthly budgets: also alert when the month-end forecast reaches these percentages, e.g.[100]. Each alert (actual or forecast) is also theews.billingevent "Budget Threshold Crossed" on the default event bus.notification_emails(List of String) Who the alerts go to.scope(String) What it covers (JSON):{ type = "organization" },{ type = "project", projectId = dcloud_project.p.id }or{ type = "tags", clauses = [{ key = "env", values = ["prod"] }] }. Default: the organization. Usejsonencode.service_filter(List of String) Only these services' costs, e.g.["ec2", "rds"]; empty means all.
Read-Only
id(String) The resource's id.
Import
Import is supported using the following syntax:
The terraform import command can be used, for example:
terraform import dcloud_budget.payments <budget-id>Generated from the provider's schema.
Related