mirror of
https://github.com/opentofu/opentofu.git
synced 2025-01-18 12:42:58 -06:00
f407eea3f7
- Don't drop wildcard if it's the only one. - Remove monitor resource, it's been replaced by metric_alert, outlier_alert and service_check - Refactor to be closer to the API; each resource creates exactly *one* resource, not 2, this removes much unneeded complexity. A warning threshold is now supported by the API. - Remove fuzzy resources like graph, and resources that used them for dashboard and screenboards. I'd welcome these resources, but the current state of Terraform and the Datadog API does not allow these to be implemented in a clean way. - Support multiple thresholds for metric alerts, remove notify argument.
24 lines
405 B
Go
24 lines
405 B
Go
package datadog
|
|
|
|
import (
|
|
"log"
|
|
|
|
"github.com/zorkian/go-datadog-api"
|
|
)
|
|
|
|
// Config holds API and APP keys to authenticate to Datadog.
|
|
type Config struct {
|
|
APIKey string
|
|
APPKey string
|
|
}
|
|
|
|
// Client returns a new Datadog client.
|
|
func (c *Config) Client() (*datadog.Client, error) {
|
|
|
|
client := datadog.NewClient(c.APIKey, c.APPKey)
|
|
|
|
log.Printf("[INFO] Datadog Client configured ")
|
|
|
|
return client, nil
|
|
}
|