Skip to content

After removing Version tag in lambda getting error retrieving datadog API key from secret manager #118

Description

@pvicente

Hi, I've been using the datadog_lambda_extension for a while and I didn't experience any problem and with docker image in lambda

COPY --from=public.ecr.aws/datadog/lambda-extension:35 /opt/extensions/ /opt/extensions

Now, I'm doing a refactor of my terraform code and I've removed Version tag from lambda and I'm getting this error,

2023-02-20 16:56:16 UTC \| DD_EXTENSION \| ERROR \| Error while trying to read an API Key from Secrets Manager: Secrets Manager read error: RequestError: send request failed
--
  | 2023-02-20T17:56:16.880+01:00 | caused by: Post "https://secretsmanager.eu-west-1.amazonaws.com/": dial tcp 52.16.54.217:443: i/o timeout
  | 2023-02-20T17:56:16.880+01:00 | 2023-02-20 16:56:16 UTC \| DD_EXTENSION \| ERROR \| No API key configured, exiting
  | 2023-02-20T17:56:16.883+01:00 | TELEMETRY Name: datadog-agent State: Subscribed Types: [Platform, Function, Extension]
  | 2023-02-20T17:56:16.883+01:00 | 2023-02-20 16:56:16 UTC \| DD_EXTENSION \| ERROR \| Unable to load trace agent config: you must specify an API Key, either via a configuration file or the DD_API_KEY env var
  | 2023-02-20T17:56:16.886+01:00 | EXTENSION Name: datadog-agent State: Registered Events: [INVOKE,SHUTDOWN]

I've followed https://docs.datadoghq.com/serverless/installation/python/?tab=containerimage and I've checked

4. Configure the Datadog site, API key, and tracing

Set the environment variable DD_SITE to datadoghq.com (ensure the correct SITE is selected on the right).
Set the environment variable DD_API_KEY_SECRET_ARN with the ARN of the AWS secret where your [Datadog API key](https://app.datadoghq.com/organization-settings/api-keys) is securely stored. The key needs to be stored as a plaintext string (not a JSON blob). The secretsmanager:GetSecretValue permission is required. For quick testing, you can use DD_API_KEY instead and set the Datadog API key in plaintext.
Set the environment variable DD_TRACE_ENABLED to true.

which I've followed before and checked that key is there. If I revert the commit and put Version tag back again it works.

Any idea why this is so important? I cannot find anywhere in the docs where it says lambda has to be tagged with Version.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions