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

feat: Decouple `extensionLayerVersion` from `addLayers` #303

Closed samchungy closed 1 month ago

samchungy commented 1 month ago

What does this PR do?

Resolves https://github.com/DataDog/datadog-cdk-constructs/issues/201

Motivation

I would like to instrument my lambda with the node libraries without layers but the extension library is required to be added as a layer.

At the moment I use an ugly workaround to allow for this behaviour.

https://github.com/seek-oss/skuba/blob/ca287dfa624f1739fbb349bc22dfde3be9b09919/template/lambda-sqs-worker-cdk/infra/appStack.ts#L130-L139

Testing Guidelines

Additional Notes

Types of Changes

Arguably this is a minor breaking change if the user was relying on addLayers to prevent layers from being added whilst specifying the extensionLayerVersion but I would hope that this is uncommon.

Check all that apply

samchungy commented 1 month ago

Heyo @neko-dd and/or @astuyve or @duncanista could I trouble you for a merge/release or more feedback if this approach is particularly troubling? Cheers 😄

neko-dd commented 1 month ago

Docs doesn't merge in this repo - I'll check in tomorrow to see if someone else has merged this, and if not I'll try to escalate for you. Thanks!

lym953 commented 1 month ago

Confirmed with @purple4reina and @TophrC-dd that this PR is good. Merging.

lym953 commented 1 month ago

Merged and released.

samchungy commented 1 month ago

Appreciate it, thanks!