Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[datadog_monitor] Add cost alert monitors #2769

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

klara-kr
Copy link

@klara-kr klara-kr commented Jan 15, 2025

Adding terraform support for the cost alert monitors

I did have an example in https://github.com/DataDog/terraform-provider-datadog/blob/6fe11d82a1ca55992e511236236577c9f31af879/docs/guides/monitors.md but it was removed when I ran make docs -- let me know if I should add it back

## Cost Monitors

```terraform
resource "datadog_monitor" "process_alert_example" {
  name    = "Cost Alert Monitor"
  type    = "cost alert"
  message = "Cost Change increased more than 50$ in the last 30 days"
  query   = "formula('query').last('30d').change('absolute') > 50"
  monitor_thresholds {
    critical = 50
  }
  
  variables = [
    {
      name  = "query"
      value = "sum:aws.cost.amortized{*} by {service}.rollup(sum, daily)"
      aggregator = "sum"
      data_source = "cloud_cost"
    }
  ]
  renotify_interval = 60
}

@klara-kr klara-kr force-pushed the kara/add-cost-alert-monitors branch from a5a1379 to ef8089a Compare January 20, 2025 09:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants