mirror of
https://github.com/opentofu/opentofu.git
synced 2025-01-16 03:32:54 -06:00
10d68d90dd
* provider/datadog 9869: Validate credentials when initialising client. * provider/datadog Pull in new version of go-datadog-api. * provider/datadog Update testAccCheckDatadogMonitorConfigNoThresholds test config.
23 lines
390 B
Go
23 lines
390 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 {
|
|
|
|
client := datadog.NewClient(c.APIKey, c.APPKey)
|
|
log.Printf("[INFO] Datadog Client configured ")
|
|
|
|
return client
|
|
}
|