Initial commit: Terraform configurations for multiple cloud providers
This commit is contained in:
51
datadog/test-datadog.tf
Normal file
51
datadog/test-datadog.tf
Normal file
@@ -0,0 +1,51 @@
|
||||
terraform {
|
||||
required_providers {
|
||||
datadog = {
|
||||
source = "DataDog/datadog"
|
||||
version = "~> 3.0"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
# Provider configuration
|
||||
provider "datadog" {
|
||||
api_key = var.datadog_api_key
|
||||
app_key = var.datadog_app_key
|
||||
api_url = var.datadog_site
|
||||
}
|
||||
|
||||
# Variables
|
||||
variable "datadog_api_key" {
|
||||
description = "Datadog API key"
|
||||
type = string
|
||||
sensitive = true
|
||||
}
|
||||
|
||||
variable "datadog_app_key" {
|
||||
description = "Datadog APP key"
|
||||
type = string
|
||||
sensitive = true
|
||||
}
|
||||
|
||||
variable "datadog_site" {
|
||||
description = "Datadog site URL"
|
||||
type = string
|
||||
default = "https://api.datadoghq.com"
|
||||
}
|
||||
|
||||
# Example resource - Datadog Monitor
|
||||
resource "datadog_monitor" "test_monitor" {
|
||||
name = "Test Monitor"
|
||||
type = "metric alert"
|
||||
query = "avg(last_1h):avg:system.cpu.user{*} > 80"
|
||||
message = "CPU usage is too high"
|
||||
escalation_message = "Escalation message"
|
||||
|
||||
monitor_thresholds {
|
||||
critical = "80"
|
||||
}
|
||||
|
||||
lifecycle {
|
||||
ignore_changes = [query] # For testing purposes
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user