DataDog / datadog-cdk-constructs

CDK construct library to automagically instrument your Lambda functions with Datadog
Apache License 2.0
65 stars 28 forks source link

DataDogKey Secret not accept Secret which contains JSON format with multiple Secrets. #316

Open ranayash45 opened 1 month ago

ranayash45 commented 1 month ago

Expected Behavior

Secret: { "Other Secret":"", "Datadog_Secret":"", }

Input:- Datadog_key Secret Name: "Datadog_Secret"

OR

Provide way to give key in plain format and Datadog construct handled in it its own way.

Actual Behaviour

Currently it will accept only Key inside the secret.

Steps to Reproduce the Problem

  1. Put Datadog Key in Secrets in JSON Format.
  2. Passed ISecret into Datadog Construct.
  3. Deploy app on AWS CDK to check whether Key is loaded or not. (Cloud Watch Logs Helpful Here).

Specifications

Stacktrace

  Paste here
purple4reina commented 1 month ago

Hi @ranayash45,

Thanks for reaching out. As you mentioned, our Datadog Lambda Extension only supports plaintext secrets, not secrets inside of json objects. Therefore, you will need to create a new secret just for your Datadog API key.

Is there a specific reason why this does not work for you or is not preferred?

ranayash45 commented 1 month ago

In applications usually we have multiple secrets to handle and storing Datadog secret separately will not cause any issue. But as developer we expect that all application related secrets should be stored at single place according to environment such as Testing and Production.

So it will be easy to other developer to find dd-secret under the umbrella of application secret.

it is little tedious to handle one extra secret.

purple4reina commented 1 month ago

Hi @ranayash45,

Thanks for that detailed explanation. That makes sense that you would want the Datadog secret in with all your other secrets.

I've gone ahead and filed a feature request for you. We'll update this issue with any progress.

ranayash45 commented 1 week ago

What's the status of this ticket?