datadog-cdk-constructs-v2 3.2.2__tar.gz → 3.3.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {datadog_cdk_constructs_v2-3.2.2/src/datadog_cdk_constructs_v2.egg-info → datadog_cdk_constructs_v2-3.3.0}/PKG-INFO +90 -54
- {datadog_cdk_constructs_v2-3.2.2 → datadog_cdk_constructs_v2-3.3.0}/README.md +87 -51
- {datadog_cdk_constructs_v2-3.2.2 → datadog_cdk_constructs_v2-3.3.0}/setup.py +4 -4
- {datadog_cdk_constructs_v2-3.2.2 → datadog_cdk_constructs_v2-3.3.0}/src/datadog_cdk_constructs_v2/__init__.py +131 -61
- {datadog_cdk_constructs_v2-3.2.2 → datadog_cdk_constructs_v2-3.3.0}/src/datadog_cdk_constructs_v2/_jsii/__init__.py +2 -2
- datadog_cdk_constructs_v2-3.3.0/src/datadog_cdk_constructs_v2/_jsii/datadog-cdk-constructs-v2@3.3.0.jsii.tgz +0 -0
- {datadog_cdk_constructs_v2-3.2.2 → datadog_cdk_constructs_v2-3.3.0/src/datadog_cdk_constructs_v2.egg-info}/PKG-INFO +90 -54
- {datadog_cdk_constructs_v2-3.2.2 → datadog_cdk_constructs_v2-3.3.0}/src/datadog_cdk_constructs_v2.egg-info/SOURCES.txt +1 -1
- {datadog_cdk_constructs_v2-3.2.2 → datadog_cdk_constructs_v2-3.3.0}/src/datadog_cdk_constructs_v2.egg-info/requires.txt +2 -2
- datadog_cdk_constructs_v2-3.2.2/src/datadog_cdk_constructs_v2/_jsii/datadog-cdk-constructs-v2@3.2.2.jsii.tgz +0 -0
- {datadog_cdk_constructs_v2-3.2.2 → datadog_cdk_constructs_v2-3.3.0}/LICENSE +0 -0
- {datadog_cdk_constructs_v2-3.2.2 → datadog_cdk_constructs_v2-3.3.0}/MANIFEST.in +0 -0
- {datadog_cdk_constructs_v2-3.2.2 → datadog_cdk_constructs_v2-3.3.0}/NOTICE +0 -0
- {datadog_cdk_constructs_v2-3.2.2 → datadog_cdk_constructs_v2-3.3.0}/pyproject.toml +0 -0
- {datadog_cdk_constructs_v2-3.2.2 → datadog_cdk_constructs_v2-3.3.0}/setup.cfg +0 -0
- {datadog_cdk_constructs_v2-3.2.2 → datadog_cdk_constructs_v2-3.3.0}/src/datadog_cdk_constructs_v2/py.typed +0 -0
- {datadog_cdk_constructs_v2-3.2.2 → datadog_cdk_constructs_v2-3.3.0}/src/datadog_cdk_constructs_v2.egg-info/dependency_links.txt +0 -0
- {datadog_cdk_constructs_v2-3.2.2 → datadog_cdk_constructs_v2-3.3.0}/src/datadog_cdk_constructs_v2.egg-info/top_level.txt +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: datadog-cdk-constructs-v2
|
|
3
|
-
Version: 3.
|
|
3
|
+
Version: 3.3.0
|
|
4
4
|
Summary: CDK Construct Library to automatically instrument Python and Node Lambda functions with Datadog using AWS CDK v2
|
|
5
5
|
Home-page: https://github.com/DataDog/datadog-cdk-constructs
|
|
6
6
|
Author: Datadog
|
|
@@ -20,9 +20,9 @@ Requires-Python: ~=3.9
|
|
|
20
20
|
Description-Content-Type: text/markdown
|
|
21
21
|
License-File: LICENSE
|
|
22
22
|
License-File: NOTICE
|
|
23
|
-
Requires-Dist: aws-cdk-lib<3.0.0,>=2.
|
|
23
|
+
Requires-Dist: aws-cdk-lib<3.0.0,>=2.214.1
|
|
24
24
|
Requires-Dist: constructs<11.0.0,>=10.0.5
|
|
25
|
-
Requires-Dist: jsii<2.0.0,>=1.
|
|
25
|
+
Requires-Dist: jsii<2.0.0,>=1.118.0
|
|
26
26
|
Requires-Dist: publication>=0.0.3
|
|
27
27
|
Requires-Dist: typeguard<4.3.0,>=2.13.3
|
|
28
28
|
|
|
@@ -41,7 +41,7 @@ For more information on the **DatadogECSFargate** construct, see [here](https://
|
|
|
41
41
|
|
|
42
42
|
This CDK library automatically configures ingestion of metrics, traces, and logs from your serverless applications by:
|
|
43
43
|
|
|
44
|
-
* Installing and configuring the Datadog Lambda layers for your [
|
|
44
|
+
* Installing and configuring the Datadog Lambda layers for your [Python](https://github.com/DataDog/datadog-lambda-layer-python), [Node.js](https://github.com/DataDog/datadog-lambda-layer-js), [Java](https://docs.datadoghq.com/serverless/installation/java/?tab=awscdk), [Go](https://docs.datadoghq.com/serverless/aws_lambda/installation/go), [Ruby](https://docs.datadoghq.com/serverless/aws_lambda/installation/ruby), and [.NET](https://docs.datadoghq.com/serverless/aws_lambda/installation/dotnet) Lambda functions.
|
|
45
45
|
* Enabling the collection of traces and custom metrics from your Lambda functions.
|
|
46
46
|
* Managing subscriptions from the Datadog Forwarder to your Lambda and non-Lambda log groups.
|
|
47
47
|
|
|
@@ -100,7 +100,7 @@ Pay attention to the output from your package manager as the `Datadog CDK Constr
|
|
|
100
100
|
For use with AWS CDK v2:
|
|
101
101
|
|
|
102
102
|
```
|
|
103
|
-
go get github.com/DataDog/datadog-cdk-constructs-go/ddcdkconstruct/
|
|
103
|
+
go get github.com/DataDog/datadog-cdk-constructs-go/ddcdkconstruct/v3
|
|
104
104
|
```
|
|
105
105
|
|
|
106
106
|
AWS CDK v1 is not supported.
|
|
@@ -122,9 +122,10 @@ const datadogLambda = new DatadogLambda(this, "datadogLambda", {
|
|
|
122
122
|
nodeLayerVersion: <LAYER_VERSION>,
|
|
123
123
|
pythonLayerVersion: <LAYER_VERSION>,
|
|
124
124
|
javaLayerVersion: <LAYER_VERSION>,
|
|
125
|
-
dotnetLayerVersion: <LAYER_VERSION
|
|
125
|
+
dotnetLayerVersion: <LAYER_VERSION>,
|
|
126
|
+
rubyLayerVersion: <LAYER_VERSION>,
|
|
126
127
|
addLayers: <BOOLEAN>,
|
|
127
|
-
extensionLayerVersion:
|
|
128
|
+
extensionLayerVersion: <EXTENSION_VERSION>,
|
|
128
129
|
forwarderArn: "<FORWARDER_ARN>",
|
|
129
130
|
createForwarderPermissions: <BOOLEAN>,
|
|
130
131
|
flushMetricsToLogs: <BOOLEAN>,
|
|
@@ -147,17 +148,42 @@ datadogLambda.addLambdaFunctions([<LAMBDA_FUNCTIONS>])
|
|
|
147
148
|
datadogLambda.addForwarderToNonLambdaLogGroups([<LOG_GROUPS>])
|
|
148
149
|
```
|
|
149
150
|
|
|
151
|
+
#### Python
|
|
152
|
+
|
|
153
|
+
```python
|
|
154
|
+
from datadog_cdk_constructs_v2 import DatadogLambda
|
|
155
|
+
datadog = DatadogLambda(
|
|
156
|
+
self,
|
|
157
|
+
"Datadog",
|
|
158
|
+
dotnet_layer_version=<LAYER_VERSION>,
|
|
159
|
+
node_layer_version=<LAYER_VERSION>,
|
|
160
|
+
python_layer_version=<LAYER_VERSION>,
|
|
161
|
+
ruby_layer_version=<LAYER_VERSION>,
|
|
162
|
+
java_layer_version=<LAYER_VERSION>,
|
|
163
|
+
extension_layer_version=<EXTENSION_VERSION>,
|
|
164
|
+
add_layers=<BOOLEAN>,
|
|
165
|
+
api_key=os.getenv("DD_API_KEY"),
|
|
166
|
+
site=<SITE>,
|
|
167
|
+
)
|
|
168
|
+
datadog.add_lambda_functions([<LAMBDA_FUNCTIONS>])
|
|
169
|
+
datadog.add_forwarder_to_non_lambda_log_groups(self.logGroups)
|
|
170
|
+
```
|
|
171
|
+
|
|
150
172
|
#### Go
|
|
151
173
|
|
|
152
174
|
```go
|
|
153
175
|
import (
|
|
154
|
-
"github.com/DataDog/datadog-cdk-constructs-go/ddcdkconstruct/
|
|
176
|
+
"github.com/DataDog/datadog-cdk-constructs-go/ddcdkconstruct/v3"
|
|
155
177
|
)
|
|
156
178
|
datadogLambda := ddcdkconstruct.NewDatadogLambda(
|
|
157
179
|
stack,
|
|
158
180
|
jsii.String("Datadog"),
|
|
159
181
|
&ddcdkconstruct.DatadogLambdaProps{
|
|
160
182
|
NodeLayerVersion: jsii.Number(<LAYER_VERSION>),
|
|
183
|
+
PythonLayerVersion: jsii.Number(<LAYER_VERSION>),
|
|
184
|
+
JavaLayerVersion: jsii.Number(<LAYER_VERSION>),
|
|
185
|
+
DotnetLayerVersion: jsii.Number(<LAYER_VERSION>),
|
|
186
|
+
RubyLayerVersion: jsii.Number(<LAYER_VERSION>),
|
|
161
187
|
AddLayers: jsii.Bool(<BOOLEAN>),
|
|
162
188
|
Site: jsii.String(<SITE>),
|
|
163
189
|
ApiKey: jsii.String(os.Getenv("DD_API_KEY")),
|
|
@@ -243,52 +269,53 @@ To further configure your DatadogLambda construct for Lambda, use the following
|
|
|
243
269
|
|
|
244
270
|
*Note*: The descriptions use the npm package parameters, but they also apply to PyPI and Go package parameters.
|
|
245
271
|
|
|
246
|
-
| npm package parameter | PyPI package parameter | Description
|
|
247
|
-
| ---------------------------- | ------------------------------- |
|
|
248
|
-
| `addLayers` | `add_layers` | Whether to add the runtime Lambda Layers or expect the user to bring their own. Defaults to `true`. When `true`, the Lambda Library version variables are also required. When `false`, you must include the Datadog Lambda library in your functions' deployment packages.
|
|
249
|
-
| `pythonLayerVersion` | `python_layer_version` | Version of the Python Lambda layer to install, such as `83`. Required if you are deploying at least one Lambda function written in Python and `addLayers` is `true`. Find the latest version number [here](https://github.com/DataDog/datadog-lambda-python/releases). **Warning**: This parameter and `pythonLayerArn` are mutually exclusive. If used, only set one or the other.
|
|
250
|
-
| `pythonLayerArn` | `python_layer_arn` | The custom ARN of the Python Lambda layer to install. Required if you are deploying at least one Lambda function written in Python and `addLayers` is `true`. **Warning**: This parameter and `pythonLayerVersion` are mutually exclusive. If used, only set one or the other.
|
|
251
|
-
| `nodeLayerVersion` | `node_layer_version` | Version of the Node.js Lambda layer to install, such as `100`. Required if you are deploying at least one Lambda function written in Node.js and `addLayers` is `true`. Find the latest version number from [here](https://github.com/DataDog/datadog-lambda-js/releases). **Warning**: This parameter and `nodeLayerArn` are mutually exclusive. If used, only set one or the other.
|
|
252
|
-
| `nodeLayerArn` | `node_layer_arn` | The custom ARN of the Node.js Lambda layer to install. Required if you are deploying at least one Lambda function written in Node.js and `addLayers` is `true`. **Warning**: This parameter and `nodeLayerVersion` are mutually exclusive. If used, only set one or the other.
|
|
253
|
-
| `javaLayerVersion` | `java_layer_version` | Version of the Java layer to install, such as `8`. Required if you are deploying at least one Lambda function written in Java and `addLayers` is `true`. Find the latest version number in the [Serverless Java installation documentation](https://docs.datadoghq.com/serverless/installation/java/?tab=awscdk). **Note**: `extensionLayerVersion >= 25` and `javaLayerVersion >= 5` are required for the DatadogLambda construct to instrument your Java functions properly. **Warning**: This parameter and `javaLayerArn` are mutually exclusive. If used, only set one or the other.
|
|
254
|
-
| `javaLayerArn` | `java_layer_arn` | The custom ARN of the Java layer to install. Required if you are deploying at least one Lambda function written in Java and `addLayers` is `true`. **Warning**: This parameter and `javaLayerVersion` are mutually exclusive. If used, only set one or the other.
|
|
255
|
-
| `dotnetLayerVersion` | `dotnet_layer_version` | Version of the .NET layer to install, such as `13`. Required if you are deploying at least one Lambda function written in .NET and `addLayers` is `true`. Find the latest version number from [here](https://github.com/DataDog/dd-trace-dotnet-aws-lambda-layer/releases). **Warning**: This parameter and `dotnetLayerArn` are mutually exclusive. If used, only set one or the other.
|
|
256
|
-
| `dotnetLayerArn` | `dotnet_layer_arn` | The custom ARN of the .NET layer to install. Required if you are deploying at least one Lambda function written in .NET and `addLayers` is `true`. **Warning**: This parameter and `dotnetLayerVersion` are mutually exclusive. If used, only set one or the other. .
|
|
257
|
-
| `extensionLayerVersion` | `extension_layer_version` | Version of the Datadog Lambda Extension layer to install, such as 5. When `extensionLayerVersion` is set, `apiKey` (or if encrypted, `apiKMSKey`, `apiKeySecret`, or `apiKeySecretArn`) needs to be set as well. When enabled, lambda function log groups will not be subscribed by the forwarder. Learn more about the Lambda extension [here](https://docs.datadoghq.com/serverless/datadog_lambda_library/extension/). **Warning**: This parameter and `extensionVersionArn` are mutually exclusive. Set only one or the other. **Note**: If this parameter is set, it adds a layer even if `addLayers` is set to `false`.
|
|
258
|
-
| `extensionLayerArn` | `extension_layer_arn` | The custom ARN of the Datadog Lambda Extension layer to install. When `extensionLayerArn` is set, `apiKey` (or if encrypted, `apiKMSKey`, `apiKeySecret`, or `apiKeySecretArn`) needs to be set as well. When enabled, lambda function log groups are not subscribed by the forwarder. Learn more about the Lambda extension [here](https://docs.datadoghq.com/serverless/datadog_lambda_library/extension/). **Warning**: This parameter and`extensionLayerVersion` are mutually exclusive. If used, only set one or the other. **Note**: If this parameter is set, it adds a layer even if `addLayers` is set to `false`.
|
|
259
|
-
| `forwarderArn` | `forwarder_arn` | When set, the plugin automatically subscribes the Datadog Forwarder to the functions' log groups. Do not set `forwarderArn` when `extensionLayerVersion` or `extensionLayerArn` is set.
|
|
260
|
-
| `createForwarderPermissions` | `createForwarderPermissions` | When set to `true`, creates a Lambda permission on the the Datadog Forwarder per log group. Since the Datadog Forwarder has permissions configured by default, this is unnecessary in most use cases.
|
|
261
|
-
| `flushMetricsToLogs` | `flush_metrics_to_logs` | Send custom metrics using CloudWatch logs with the Datadog Forwarder Lambda function (recommended). Defaults to `true` . If you disable this parameter, it's required to set `apiKey` (or if encrypted, `apiKMSKey`, `apiKeySecret`, or `apiKeySecretArn`).
|
|
262
|
-
| `site` | `site` | Set which Datadog site to send data. This is only used when `flushMetricsToLogs` is `false` or `extensionLayerVersion` or `extensionLayerArn` is set. Possible values are `datadoghq.com`, `datadoghq.eu`, `us3.datadoghq.com`, `us5.datadoghq.com`, `ap1.datadoghq.com`, `ap2.datadoghq.com`, and `ddog-gov.com`. The default is `datadoghq.com`.
|
|
263
|
-
| `apiKey` | `api_key` | Datadog API Key, only needed when `flushMetricsToLogs` is `false` or `extensionLayerVersion` or `extensionLayerArn` is set. For more information about getting a Datadog API key, see the [API key documentation](https://docs.datadoghq.com/account_management/api-app-keys/#api-keys).
|
|
264
|
-
| `apiKeySecretArn` | `api_key_secret_arn` | The ARN of the secret storing the Datadog API key in AWS Secrets Manager. Use this parameter in place of `apiKey` when `flushMetricsToLogs` is `false` or `extensionLayer` is set. Remember to add the `secretsmanager:GetSecretValue` permission to the Lambda execution role.
|
|
265
|
-
| `apiKeySecret` | `api_key_secret` | An [AWS CDK ISecret](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_secretsmanager.ISecret.html) representing a secret storing the Datadog API key in AWS Secrets Manager. Use this parameter in place of `apiKeySecretArn` to automatically grant your Lambda execution roles read access to the given secret. [See here](#automatically-grant-aws-secret-read-access-to-lambda-execution-role) for an example. **Only available in datadog-cdk-constructs-v2**.
|
|
266
|
-
| `apiKmsKey` | `api_kms_key` | Datadog API Key encrypted using KMS. Use this parameter in place of `apiKey` when `flushMetricsToLogs` is `false` or `extensionLayerVersion` or `extensionLayerArn` is set, and you are using KMS encryption.
|
|
267
|
-
| `enableDatadogTracing` | `enable_datadog_tracing` | Enable Datadog tracing on your Lambda functions. Defaults to `true`.
|
|
268
|
-
| `enableMergeXrayTraces` | `enable_merge_xray_traces` | Enable merging X-Ray traces on your Lambda functions. Defaults to `false`.
|
|
269
|
-
| `enableDatadogLogs` | `enable_datadog_logs` | Send Lambda function logs to Datadog via the Datadog Lambda Extension. Defaults to `true`. Note: This setting has no effect on logs sent via the Datadog Forwarder.
|
|
270
|
-
| `enableDatadogASM` | `enable_datadog_asm` | Enable [Datadog
|
|
271
|
-
| `
|
|
272
|
-
| `
|
|
273
|
-
| `
|
|
274
|
-
| `
|
|
275
|
-
| `
|
|
276
|
-
| `
|
|
277
|
-
| `
|
|
278
|
-
| `
|
|
279
|
-
| `
|
|
280
|
-
| `
|
|
281
|
-
| `
|
|
282
|
-
| `
|
|
283
|
-
| `
|
|
284
|
-
| `
|
|
285
|
-
| `
|
|
286
|
-
| `
|
|
287
|
-
| `
|
|
288
|
-
| `
|
|
289
|
-
| `
|
|
290
|
-
| `
|
|
291
|
-
| `
|
|
272
|
+
| npm package parameter | PyPI package parameter | Description |
|
|
273
|
+
| ---------------------------- | ------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
274
|
+
| `addLayers` | `add_layers` | Whether to add the runtime Lambda Layers or expect the user to bring their own. Defaults to `true`. When `true`, the Lambda Library version variables are also required. When `false`, you must include the Datadog Lambda library in your functions' deployment packages. |
|
|
275
|
+
| `pythonLayerVersion` | `python_layer_version` | Version of the Python Lambda layer to install, such as `83`. Required if you are deploying at least one Lambda function written in Python and `addLayers` is `true`. Find the latest version number [here](https://github.com/DataDog/datadog-lambda-python/releases). **Warning**: This parameter and `pythonLayerArn` are mutually exclusive. If used, only set one or the other. |
|
|
276
|
+
| `pythonLayerArn` | `python_layer_arn` | The custom ARN of the Python Lambda layer to install. Required if you are deploying at least one Lambda function written in Python and `addLayers` is `true`. **Warning**: This parameter and `pythonLayerVersion` are mutually exclusive. If used, only set one or the other. |
|
|
277
|
+
| `nodeLayerVersion` | `node_layer_version` | Version of the Node.js Lambda layer to install, such as `100`. Required if you are deploying at least one Lambda function written in Node.js and `addLayers` is `true`. Find the latest version number from [here](https://github.com/DataDog/datadog-lambda-js/releases). **Warning**: This parameter and `nodeLayerArn` are mutually exclusive. If used, only set one or the other. |
|
|
278
|
+
| `nodeLayerArn` | `node_layer_arn` | The custom ARN of the Node.js Lambda layer to install. Required if you are deploying at least one Lambda function written in Node.js and `addLayers` is `true`. **Warning**: This parameter and `nodeLayerVersion` are mutually exclusive. If used, only set one or the other. |
|
|
279
|
+
| `javaLayerVersion` | `java_layer_version` | Version of the Java layer to install, such as `8`. Required if you are deploying at least one Lambda function written in Java and `addLayers` is `true`. Find the latest version number in the [Serverless Java installation documentation](https://docs.datadoghq.com/serverless/installation/java/?tab=awscdk). **Note**: `extensionLayerVersion >= 25` and `javaLayerVersion >= 5` are required for the DatadogLambda construct to instrument your Java functions properly. **Warning**: This parameter and `javaLayerArn` are mutually exclusive. If used, only set one or the other. |
|
|
280
|
+
| `javaLayerArn` | `java_layer_arn` | The custom ARN of the Java layer to install. Required if you are deploying at least one Lambda function written in Java and `addLayers` is `true`. **Warning**: This parameter and `javaLayerVersion` are mutually exclusive. If used, only set one or the other. |
|
|
281
|
+
| `dotnetLayerVersion` | `dotnet_layer_version` | Version of the .NET layer to install, such as `13`. Required if you are deploying at least one Lambda function written in .NET and `addLayers` is `true`. Find the latest version number from [here](https://github.com/DataDog/dd-trace-dotnet-aws-lambda-layer/releases). **Warning**: This parameter and `dotnetLayerArn` are mutually exclusive. If used, only set one or the other. |
|
|
282
|
+
| `dotnetLayerArn` | `dotnet_layer_arn` | The custom ARN of the .NET layer to install. Required if you are deploying at least one Lambda function written in .NET and `addLayers` is `true`. **Warning**: This parameter and `dotnetLayerVersion` are mutually exclusive. If used, only set one or the other. . |
|
|
283
|
+
| `extensionLayerVersion` | `extension_layer_version` | Version of the Datadog Lambda Extension layer to install, such as 5. When `extensionLayerVersion` is set, `apiKey` (or if encrypted, `apiKMSKey`, `apiKeySecret`, or `apiKeySecretArn`) needs to be set as well. When enabled, lambda function log groups will not be subscribed by the forwarder. Learn more about the Lambda extension [here](https://docs.datadoghq.com/serverless/datadog_lambda_library/extension/). **Warning**: This parameter and `extensionVersionArn` are mutually exclusive. Set only one or the other. **Note**: If this parameter is set, it adds a layer even if `addLayers` is set to `false`. |
|
|
284
|
+
| `extensionLayerArn` | `extension_layer_arn` | The custom ARN of the Datadog Lambda Extension layer to install. When `extensionLayerArn` is set, `apiKey` (or if encrypted, `apiKMSKey`, `apiKeySecret`, or `apiKeySecretArn`) needs to be set as well. When enabled, lambda function log groups are not subscribed by the forwarder. Learn more about the Lambda extension [here](https://docs.datadoghq.com/serverless/datadog_lambda_library/extension/). **Warning**: This parameter and`extensionLayerVersion` are mutually exclusive. If used, only set one or the other. **Note**: If this parameter is set, it adds a layer even if `addLayers` is set to `false`. |
|
|
285
|
+
| `forwarderArn` | `forwarder_arn` | When set, the plugin automatically subscribes the Datadog Forwarder to the functions' log groups. Do not set `forwarderArn` when `extensionLayerVersion` or `extensionLayerArn` is set. |
|
|
286
|
+
| `createForwarderPermissions` | `createForwarderPermissions` | When set to `true`, creates a Lambda permission on the the Datadog Forwarder per log group. Since the Datadog Forwarder has permissions configured by default, this is unnecessary in most use cases. |
|
|
287
|
+
| `flushMetricsToLogs` | `flush_metrics_to_logs` | Send custom metrics using CloudWatch logs with the Datadog Forwarder Lambda function (recommended). Defaults to `true` . If you disable this parameter, it's required to set `apiKey` (or if encrypted, `apiKMSKey`, `apiKeySecret`, or `apiKeySecretArn`). |
|
|
288
|
+
| `site` | `site` | Set which Datadog site to send data. This is only used when `flushMetricsToLogs` is `false` or `extensionLayerVersion` or `extensionLayerArn` is set. Possible values are `datadoghq.com`, `datadoghq.eu`, `us3.datadoghq.com`, `us5.datadoghq.com`, `ap1.datadoghq.com`, `ap2.datadoghq.com`, and `ddog-gov.com`. The default is `datadoghq.com`. |
|
|
289
|
+
| `apiKey` | `api_key` | Datadog API Key, only needed when `flushMetricsToLogs` is `false` or `extensionLayerVersion` or `extensionLayerArn` is set. For more information about getting a Datadog API key, see the [API key documentation](https://docs.datadoghq.com/account_management/api-app-keys/#api-keys). |
|
|
290
|
+
| `apiKeySecretArn` | `api_key_secret_arn` | The ARN of the secret storing the Datadog API key in AWS Secrets Manager. Use this parameter in place of `apiKey` when `flushMetricsToLogs` is `false` or `extensionLayer` is set. Remember to add the `secretsmanager:GetSecretValue` permission to the Lambda execution role. |
|
|
291
|
+
| `apiKeySecret` | `api_key_secret` | An [AWS CDK ISecret](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_secretsmanager.ISecret.html) representing a secret storing the Datadog API key in AWS Secrets Manager. Use this parameter in place of `apiKeySecretArn` to automatically grant your Lambda execution roles read access to the given secret. [See here](#automatically-grant-aws-secret-read-access-to-lambda-execution-role) for an example. **Only available in datadog-cdk-constructs-v2**. |
|
|
292
|
+
| `apiKmsKey` | `api_kms_key` | Datadog API Key encrypted using KMS. Use this parameter in place of `apiKey` when `flushMetricsToLogs` is `false` or `extensionLayerVersion` or `extensionLayerArn` is set, and you are using KMS encryption. |
|
|
293
|
+
| `enableDatadogTracing` | `enable_datadog_tracing` | Enable Datadog tracing on your Lambda functions. Defaults to `true`. |
|
|
294
|
+
| `enableMergeXrayTraces` | `enable_merge_xray_traces` | Enable merging X-Ray traces on your Lambda functions. Defaults to `false`. |
|
|
295
|
+
| `enableDatadogLogs` | `enable_datadog_logs` | Send Lambda function logs to Datadog via the Datadog Lambda Extension. Defaults to `true`. Note: This setting has no effect on logs sent via the Datadog Forwarder. |
|
|
296
|
+
| `enableDatadogASM` | `enable_datadog_asm` | **Deprecated**: use `datadogAppsecMode: on` instead. Enable [Datadog App and API Protection](https://docs.datadoghq.com/security/application_security/) on the Lambda function. Requires `enableDatadogTracing` to be enabled. Defaults to `false`. |
|
|
297
|
+
| `datadogAppSecMode` | `datadog_app_sec_mode` | Enable [Datadog App and API Protection](https://docs.datadoghq.com/security/application_security/) on the Lambda function. To enable App and API Protection, set the value to `on`. Accepts `off`, `on`, `extension`, and `tracer`. The values `on`, `extension` and `tracer` require `enableDatadogTracing`. Defaults to `off`. For more information on the `tracer` and `extension` options read [Enable in-tracer App and API Protection](#enable-in-tracer-app-and-api-protection). |
|
|
298
|
+
| `captureLambdaPayload` | `capture_lambda_payload` | [Captures incoming and outgoing AWS Lambda payloads](https://www.datadoghq.com/blog/troubleshoot-lambda-function-request-response-payloads/) in the Datadog APM spans for Lambda invocations. Defaults to `false`. |
|
|
299
|
+
| `captureCloudServicePayload` | `capture_cloud_service_payload` | [Capture requests and responses between your application and AWS services](https://docs.datadoghq.com/tracing/guide/aws_payload_tagging/) in the Datadog APM spans' tags. Supported services include SNS, SQS, Kinesis, S3, EventBridge, DynamoDB. If set to `true`, it will add `DD_TRACE_CLOUD_REQUEST_PAYLOAD_TAGGING='all'` and `DD_TRACE_CLOUD_RESPONSE_PAYLOAD_TAGGING='all'`. If set to `false` it would add `DD_TRACE_CLOUD_REQUEST_PAYLOAD_TAGGING='$.*'` and `DD_TRACE_CLOUD_RESPONSE_PAYLOAD_TAGGING='$.*'`. `$.*` is a JSONPath redaction rule that redacts all values. Defaults to `false`. |
|
|
300
|
+
| `sourceCodeIntegration` | `source_code_integration` | Enable Datadog Source Code Integration, connecting your telemetry with application code in your Git repositories. This requires the Datadog Github integration to work, otherwise please follow the [alternative method](#alternative-methods-to-enable-source-code-integration). Learn more [here](https://docs.datadoghq.com/integrations/guide/source-code-integration/). Defaults to `true`. |
|
|
301
|
+
| `injectLogContext` | `inject_log_context` | When set, the Lambda layer will automatically patch console.log with Datadog's tracing ids. Defaults to `true`. |
|
|
302
|
+
| `logLevel` | `log_level` | When set to `debug`, the Datadog Lambda Library and Extension will log additional information to help troubleshoot issues. |
|
|
303
|
+
| `env` | `env` | When set along with `extensionLayerVersion` or `extensionLayerArn`, a `DD_ENV` environment variable is added to all Lambda functions with the provided value. When set along with `forwarderArn`, an `env` tag is added to all Lambda functions with the provided value. |
|
|
304
|
+
| `service` | `service` | When set along with `extensionLayerVersion` or `extensionLayerArn`, a `DD_SERVICE` environment variable is added to all Lambda functions with the provided value. When set along with `forwarderArn`, a `service` tag is added to all Lambda functions with the provided value. |
|
|
305
|
+
| `version` | `version` | When set along with `extensionLayerVersion` or `extensionLayerArn`, a `DD_VERSION` environment variable is added to all Lambda functions with the provided value. When set along with `forwarderArn`, a `version` tag is added to all Lambda functions with the provided value. |
|
|
306
|
+
| `tags` | `tags` | A comma separated list of key:value pairs as a single string. When set along with `extensionLayerVersion` or `extensionLayerArn`, a `DD_TAGS` environment variable is added to all Lambda functions with the provided value. When set along with `forwarderArn`, the cdk parses the string and sets each key:value pair as a tag to all Lambda functions. |
|
|
307
|
+
| `enableColdStartTracing` | `enable_cold_start_tracing` | Set to `false` to disable Cold Start Tracing. Used in Node.js and Python. Defaults to `true`. |
|
|
308
|
+
| `coldStartTraceMinDuration` | `min_cold_start_trace_duration` | Sets the minimum duration (in milliseconds) for a module load event to be traced via Cold Start Tracing. Number. Defaults to `3`. |
|
|
309
|
+
| `coldStartTraceSkipLibs` | `cold_start_trace_skip_libs` | Optionally skip creating Cold Start Spans for a comma-separated list of libraries. Useful to limit depth or skip known libraries. Default depends on runtime. |
|
|
310
|
+
| `enableProfiling` | `enable_profiling` | Enable the Datadog Continuous Profiler with `true`. Supported in Beta for Node.js and Python. Defaults to `false`. |
|
|
311
|
+
| `encodeAuthorizerContext` | `encode_authorizer_context` | When set to `true` for Lambda authorizers, the tracing context will be encoded into the response for propagation. Supported for Node.js and Python. Defaults to `true`. |
|
|
312
|
+
| `decodeAuthorizerContext` | `decode_authorizer_context` | When set to `true` for Lambdas that are authorized via Lambda authorizers, it will parse and use the encoded tracing context (if found). Supported for Node.js and Python. Defaults to `true`. |
|
|
313
|
+
| `apmFlushDeadline` | `apm_flush_deadline` | Used to determine when to submit spans before a timeout occurs, in milliseconds. When the remaining time in an AWS Lambda invocation is less than the value set, the tracer attempts to submit the current active spans and all finished spans. Supported for Node.js and Python. Defaults to `100` milliseconds. |
|
|
314
|
+
| `redirectHandler` | `redirect_handler` | When set to `false`, skip redirecting handler to the Datadog Lambda Library's handler. Useful when only instrumenting with Datadog Lambda Extension. Defaults to `true`. |
|
|
315
|
+
| `grantSecretReadAccess` | `grant_secret_read_access` | When set to `true` and `apiKeySecretArn` is provided, automatically grant read access to the given secret to all the lambdas added. Defaults to `true`. |
|
|
316
|
+
| `llmObsEnabled` | `llm_obs_enabled` | Toggle to enable submitting data to LLM Observability Defaults to `false`. |
|
|
317
|
+
| `llmObsMlApp` | `llm_obs_ml_app` | The name of your LLM application, service, or project, under which all traces and spans are grouped. This helps distinguish between different applications or experiments. See [Application naming guidelines](https://docs.datadoghq.com/llm_observability/sdk/?tab=nodejs#application-naming-guidelines) for allowed characters and other constraints. To override this value for a given root span, see [Tracing multiple applications](https://docs.datadoghq.com/llm_observability/sdk/?tab=nodejs#tracing-multiple-applications). Required if `llmObsEnabled` is `true` |
|
|
318
|
+
| `llmObsAgentlessEnabled` | `llm_obs_agentless_enabled` | Only required if you are not using the Datadog Lambda Extension, in which case this should be set to `true`. Defaults to `false`. |
|
|
292
319
|
|
|
293
320
|
#### Tracing
|
|
294
321
|
|
|
@@ -372,6 +399,15 @@ class NestedStack extends cdk.NestedStack {
|
|
|
372
399
|
|
|
373
400
|
Add tags to your constructs. We recommend setting an `env` and `service` tag to tie Datadog telemetry together. For more information see [official AWS documentation](https://docs.aws.amazon.com/cdk/latest/guide/tagging.html) and [CDK documentation](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.Tags.html).
|
|
374
401
|
|
|
402
|
+
#### Enable in-tracer App and API Protection
|
|
403
|
+
|
|
404
|
+
The [Datadog Lambda Library for Python](https://docs.datadoghq.com/account_management/api-app-keys/#api-keys) (version `8.114.0` or later) can run [App and API Protection](https://docs.datadoghq.com/serverless/aws_lambda/installation/dotnet) directly inside the instrumented application, giving the security engine additional context. This complements the in-extension implementation delivered by the [Datadog Lambda Extension](https://docs.datadoghq.com/serverless/datadog_lambda_library/extension/). `appSecMode` selects which implementation runs:
|
|
405
|
+
|
|
406
|
+
* `on`: with `pythonLayerVersion>=114` on Python functions, App and API Protection runs within the library; other runtimes or manually-supplied libraries fall back to the extension.
|
|
407
|
+
* `tracer`: always use the library implementation (every function must be in Python and use the Python library at version `8.114.0` or newer).
|
|
408
|
+
* `extension`: always use the extension implementation, even when a compatible library is detected.
|
|
409
|
+
* `off`: disable App and API Protection entirely.
|
|
410
|
+
|
|
375
411
|
### Automatically grant AWS secret read access to Lambda execution role
|
|
376
412
|
|
|
377
413
|
**Only available in datadog-cdk-constructs-v2**
|