You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Update Lambda Extension Installation Instructions for Datadog Lambda Terraform Module (.NET and Java) (#23954)
* bump to latest lambda datadog terraform module version
* bump to latest supported python version
* update documentation for instrumenting java lambda with terraform
* update documentation for instrumenting .net lambda with terraform
@@ -191,121 +191,60 @@ The [Datadog CloudFormation macro][1] automatically transforms your SAM applicat
191
191
{{% /tab %}}
192
192
{{% tab "Terraform" %}}
193
193
194
-
Use this format for your [Terraform resource][1]:
195
-
```sh
196
-
resource "aws_lambda_function""lambda" {
197
-
"function_name" = ...
198
-
...
199
-
200
-
# Remember sure to choose the right layers based on your Lambda architecture and AWS regions
201
-
202
-
layers = [
203
-
<DATADOG_TRACER_ARN>,
204
-
<DATADOG_EXTENSION_ARN>
205
-
]
206
-
207
-
environment {
208
-
variables = {
209
-
DD_SITE = <DATADOG_SITE>
210
-
DD_API_KEY_SECRET_ARN = <API_KEY>
211
-
AWS_LAMBDA_EXEC_WRAPPER = "/opt/datadog_wrapper"
212
-
}
194
+
The [`lambda-datadog`][1] Terraform module wraps the [`aws_lambda_function`][2] resource and automatically configures your Lambda functionfor Datadog Serverless Monitoring by:
195
+
196
+
- Adding the Datadog Lambda layers
197
+
- Redirecting the Lambda handler
198
+
- Enabling the collection and sending of metrics, traces, and logs to Datadog
In the ARN, replace `<AWS_REGION>` with a valid AWS region, such as `us-east-1`.
275
-
276
-
3. Replace `<DATADOG_SITE>` with {{< region-param key="dd_site" code="true">}} (ensure the correct SITE is selected on the right).
277
-
278
-
4. Replace `<API_KEY>` with the ARN of the AWS secret where your Datadog API key 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, use `DD_API_KEY` instead of `DD_API_KEY_SECRET_ARN` and set the value to your Datadog API key in plaintext.
279
-
280
-
281
-
#### Full example
282
-
283
-
```sh
284
-
resource "aws_lambda_function""lambda" {
285
-
"function_name" = ...
286
-
...
287
-
288
-
# Remember sure to choose the right layers based on your Lambda architecture and AWS regions
1. Replace the `aws_lambda_function` resource with the `lambda-datadog` Terraform module then specify the `source` and `version` of the module.
221
+
222
+
2. Set the `aws_lambda_function` arguments:
223
+
224
+
All of the arguments available in the `aws_lambda_function` resource are available in this Terraform module. Arguments defined as blocks in the `aws_lambda_function` resource are redefined as variables with their nested arguments.
225
+
226
+
For example, in`aws_lambda_function`, `environment` is defined as a block with a `variables` argument. In the `lambda-datadog` Terraform module, the value forthe `environment_variables` is passed to the `environment.variables` argumentin`aws_lambda_function`. See [inputs][3] fora complete list of variablesin this module.
227
+
228
+
3. Fill in the environment variable placeholders:
229
+
230
+
- Replace `<DATADOG_API_KEY_SECRET_ARN>` with the ARN of the AWS secret where your Datadog API key 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 instead use the environment variable `DD_API_KEY` and set your Datadog API key in plaintext.
231
+
- Replace `<ENVIRONMENT>` with the Lambda function's environment, such as `prod` or `staging`
232
+
- Replace `<SERVICE_NAME>` with the name of the Lambda function's service
233
+
- Replace `<DATADOG_SITE>` with {{< region-param key="dd_site" code="true">}}. (Ensure the correct [Datadog site][4] is selected on this page).
234
+
- Replace `<VERSION>` with the version number of the Lambda function
235
+
236
+
4. Select the versions of the Datadog Extension Lambda layer and Datadog .NET Lambda layer to use. Defaults to the latest layer versions.
# Remember sure to choose the right layers based on your Lambda architecture and AWS regions
273
-
274
-
layers = [
275
-
<DATADOG_TRACER_ARN>,
276
-
<DATADOG_EXTENSION_ARN>
277
-
]
278
-
279
-
environment {
280
-
variables = {
281
-
DD_SITE = <DATADOG_SITE>
282
-
DD_API_KEY_SECRET_ARN = <API_KEY>
283
-
AWS_LAMBDA_EXEC_WRAPPER = "/opt/datadog_wrapper"
284
-
}
266
+
267
+
The [`lambda-datadog`][1] Terraform module wraps the [`aws_lambda_function`][2] resource and automatically configures your Lambda functionfor Datadog Serverless Monitoring by:
268
+
269
+
- Adding the Datadog Lambda layers
270
+
- Redirecting the Lambda handler
271
+
- Enabling the collection and sending of metrics, traces, and logs to Datadog
3. Replace `<DATADOG_SITE>` with {{< region-param key="dd_site" code="true">}} (ensure the correct SITE is selected on the right).
361
-
362
-
4. Replace `<API_KEY>` with the ARN of the AWS secret where your Datadog API key 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, use `DD_API_KEY` instead of `DD_API_KEY_SECRET_ARN` and set the value to your Datadog API key in plaintext.
363
-
364
-
#### Full example
365
-
366
-
```sh
367
-
resource "aws_lambda_function""lambda" {
368
-
"function_name" = ...
369
-
...
370
-
371
-
# Remember sure to choose the right layers based on your Lambda architecture and AWS regions
1. Replace the `aws_lambda_function` resource with the `lambda-datadog` Terraform module. Then, specify the `source` and `version` of the module.
294
+
295
+
2. Set the `aws_lambda_function` arguments:
296
+
297
+
All of the arguments available in the `aws_lambda_function` resource are available in this Terraform module. Arguments defined as blocks in the `aws_lambda_function` resource are redefined as variables with their nested arguments.
298
+
299
+
For example, in`aws_lambda_function`, `environment` is defined as a block with a `variables` argument. In the `lambda-datadog` Terraform module, the value forthe `environment_variables` is passed to the `environment.variables` argumentin`aws_lambda_function`. See [inputs][3] fora complete list of variablesin this module.
300
+
301
+
3. Fill in the environment variable placeholders:
302
+
303
+
- Replace `<DATADOG_API_KEY_SECRET_ARN>` with the ARN of the AWS secret where your Datadog API key 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 instead use the environment variable `DD_API_KEY` and set your Datadog API key in plaintext.
304
+
- Replace `<ENVIRONMENT>` with the Lambda function's environment, such as `prod` or `staging`
305
+
- Replace `<SERVICE_NAME>` with the name of the Lambda function's service
306
+
- Replace `<DATADOG_SITE>` with {{< region-param key="dd_site" code="true">}}. (Ensure the correct [Datadog site][4] is selected on this page).
307
+
- Replace `<VERSION>` with the version number of the Lambda function
308
+
309
+
4. Select the versions of the Datadog Extension Lambda layer and Datadog Java Lambda layer to use. If left blank the latest layer versions will be used.
0 commit comments