DataDog / datadog-lambda-go

The Datadog AWS Lambda package for Go
Apache License 2.0
59 stars 40 forks source link

Support for DD_API_KEY_SECRET_ARN environment variable #98

Closed Hendra-Huang closed 2 years ago

Hendra-Huang commented 2 years ago

Expected Behavior

Datadog agent for serverless (https://github.com/DataDog/datadog-agent/blob/main/cmd/serverless/README.md#serverless-environment-configuration) supports retrieving datadog API key via secret, but this library didn't support it. Currently this library supports datadog API key via DD_API_KEY or DD_KMS_API_KEY environment variables. It would be really helpful for this library to support datadog API key via secret too so my AWS Lambda function can provide 1 environment variable only (DD_API_KEY_SECRET_ARN) for both the library and datadog agent extension.

skatsuta commented 2 years ago

@Hendra-Huang In fact you can already use DD_API_KEY_SECRET_ARN and DD Lambda Extension with this library (i.e. you don't need to set either DD_API_KEY or DD_KMS_API_KEY), but previously misleading error messages were displayed. This bug has just been fixed in v1.4.0, so you can now use them together as you expect.