Skip to content

Commit c43ba05

Browse files
Update Readme for Consistency with Datadog Public Docs (#7)
* update documentation to be consistent with the public Datadog docs * add site docmentation
1 parent 43f2c28 commit c43ba05

File tree

9 files changed

+36
-14
lines changed

9 files changed

+36
-14
lines changed

README.md

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,20 +14,22 @@ This Terraform module wraps the [aws_lambda_function](https://registry.terraform
1414

1515
### Python
1616
```
17-
module "example_lambda_function" {
18-
source = "Datadog/lambda-datadog/aws"
17+
module "lambda-datadog" {
18+
source = "DataDog/lambda-datadog/aws"
19+
version = "1.0.0"
1920
2021
filename = "example.zip"
2122
function_name = "example-function"
2223
role = aws_iam_role.lambda_role.arn
2324
handler = "app.lambda_handler"
2425
runtime = "python3.11"
25-
memory_size = 256
26+
memory_size = 256
2627
2728
environment_variables = {
2829
"DD_API_KEY_SECRET_ARN" : "arn:aws:secretsmanager:us-east-1:000000000000:secret:example-secret"
2930
"DD_ENV" : "dev"
3031
"DD_SERVICE" : "example-service"
32+
"DD_SITE": "datadoghq.com"
3133
"DD_VERSION" : "1.0.0"
3234
}
3335
@@ -38,20 +40,22 @@ module "example_lambda_function" {
3840

3941
### Node
4042
```
41-
module "example_lambda_function" {
42-
source = "Datadog/lambda-datadog/aws"
43+
module "lambda-datadog" {
44+
source = "DataDog/lambda-datadog/aws"
45+
version = "1.0.0"
4346
4447
filename = "example.zip"
4548
function_name = "example-function"
4649
role = aws_iam_role.lambda_role.arn
4750
handler = "index.lambda_handler"
4851
runtime = "nodejs20.x"
49-
memory_size = 256
52+
memory_size = 256
5053
5154
environment_variables = {
5255
"DD_API_KEY_SECRET_ARN" : "arn:aws:secretsmanager:us-east-1:000000000000:secret:example-secret"
5356
"DD_ENV" : "dev"
5457
"DD_SERVICE" : "example-service"
58+
"DD_SITE": "datadoghq.com"
5559
"DD_VERSION" : "1.0.0"
5660
}
5761
@@ -118,6 +122,10 @@ Use the following variables to select the versions of the Datadog Lambda layers
118122
| `datadog_node_layer_version` | Version of the [Datadog Node Lambda layer](https://github.com/DataDog/datadog-lambda-js/releases) to install |
119123
| `datadog_python_layer_version` | Version of the [Datadog Python Lambda layer](https://github.com/DataDog/datadog-lambda-python/releases) to install |
120124

125+
#### Selecting the Datadog Site
126+
127+
The default Datadog site is `datadoghq.com`. To use a different site set the `DD_SITE` environment variable to the desired destination site. See [Getting Started with Datadog Sites](https://docs.datadoghq.com/getting_started/site/) for the available site values.
128+
121129
#### Configuration
122130

123131
Use Environment variables to configure Datadog Serverless Monitoring. Refer to the documentation below for environment variables available in the Serverless Agent (packaged in the Extension layer) and in the Tracing libraries (packaged in the runtime layers).

examples/node/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ A simple Node Lambda function with out of the box Datadog instrumentation.
99
* Create a `terraform.tfvars` file
1010
- Set the `datadog_secret_arn` to the arn of the secret you just created
1111
- Set the `datadog_service_name` to the name of the service you want to use to filter for the resource in Datadog
12+
- Set the `datadog_site` to the [Datadog destination site](https://docs.datadoghq.com/getting_started/site/) for your metrics, traces, and logs
1213
* Run the following commands
1314

1415
```

examples/node/main.tf

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ data "archive_file" "zip_code" {
4848
output_path = "${path.module}/build/hello-node.zip"
4949
}
5050

51-
module "example_lambda_function" {
51+
module "lambda-datadog" {
5252
source = "../../"
5353

5454
filename = "${path.module}/build/hello-node.zip"
@@ -62,6 +62,7 @@ module "example_lambda_function" {
6262
"DD_API_KEY_SECRET_ARN" : var.datadog_secret_arn
6363
"DD_ENV" : "dev"
6464
"DD_SERVICE" : var.datadog_service_name
65+
"DD_SITE": var.datadog_site
6566
"DD_VERSION" : "1.0.0"
6667
}
6768
}

examples/node/outputs.tf

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
output "arn" {
22
description = "Amazon Resource Name (ARN) identifying your Lambda Function."
3-
value = module.example_lambda_function.arn
3+
value = module.lambda-datadog.arn
44
}
55

66
output "invoke_arn" {
77
description = "ARN to be used for invoking Lambda Function from API Gateway."
8-
value = module.example_lambda_function.invoke_arn
8+
value = module.lambda-datadog.invoke_arn
99
}
1010

1111
output "function_name" {
1212
description = "Unique name for your Lambda Function"
13-
value = module.example_lambda_function.function_name
13+
value = module.lambda-datadog.function_name
1414
}

examples/node/variables.tf

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,8 @@ variable "datadog_service_name" {
77
description = "Service used to filter for resources in Datadog"
88
type = string
99
}
10+
11+
variable "datadog_site" {
12+
description = "Destination site for your metrics, traces, and logs"
13+
type = string
14+
}

examples/python/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ A simple Python Lambda function with out of the box Datadog instrumentation.
99
* Create a `terraform.tfvars` file
1010
- Set the `datadog_secret_arn` to the arn of the secret you just created
1111
- Set the `datadog_service_name` to the name of the service you want to use to filter for the resource in Datadog
12+
- Set the `datadog_site` to the [Datadog destination site](https://docs.datadoghq.com/getting_started/site/) for your metrics, traces, and logs
1213
* Run the following commands
1314

1415
```

examples/python/main.tf

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ data "archive_file" "zip_code" {
4848
output_path = "${path.module}/build/hello-python.zip"
4949
}
5050

51-
module "example_lambda_function" {
51+
module "lambda-datadog" {
5252
source = "../../"
5353

5454
filename = "${path.module}/build/hello-python.zip"
@@ -63,6 +63,7 @@ module "example_lambda_function" {
6363
"DD_API_KEY_SECRET_ARN" : var.datadog_secret_arn
6464
"DD_ENV" : "dev"
6565
"DD_SERVICE" : var.datadog_service_name
66+
"DD_SITE": var.datadog_site
6667
"DD_VERSION" : "1.0.0"
6768
}
6869
}

examples/python/outputs.tf

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
output "arn" {
22
description = "Amazon Resource Name (ARN) identifying your Lambda Function."
3-
value = module.example_lambda_function.arn
3+
value = module.lambda-datadog.arn
44
}
55

66
output "invoke_arn" {
77
description = "ARN to be used for invoking Lambda Function from API Gateway."
8-
value = module.example_lambda_function.invoke_arn
8+
value = module.lambda-datadog.invoke_arn
99
}
1010

1111
output "function_name" {
1212
description = "Unique name for your Lambda Function"
13-
value = module.example_lambda_function.function_name
13+
value = module.lambda-datadog.function_name
1414
}

examples/python/variables.tf

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,8 @@ variable "datadog_service_name" {
77
description = "Service used to filter for resources in Datadog"
88
type = string
99
}
10+
11+
variable "datadog_site" {
12+
description = "Destination site for your metrics, traces, and logs"
13+
type = string
14+
}

0 commit comments

Comments
 (0)