Skip to content

Commit 5974b66

Browse files
authored
Merge pull request #17 from DataDog/georgi/override-dd-source
[AWSX] feat(logs forwarder): update terraform module to enable source override
2 parents 6a4c332 + 0bfc30c commit 5974b66

3 files changed

Lines changed: 17 additions & 9 deletions

File tree

README.md

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -69,15 +69,16 @@ For complete usage examples demonstrating different configuration scenarios, see
6969

7070
### Datadog Configuration
7171

72-
| Name | Description | Type | Default |
73-
| ----------------------------- | ------------------------------ | -------- | ----------------- |
74-
| dd_api_key | Datadog API key | `string` | `null` |
75-
| dd_api_key_secret_arn | ARN of secret storing API key | `string` | `null` |
76-
| dd_api_key_ssm_parameter_name | SSM parameter name for API key | `string` | `null` |
77-
| dd_site | Datadog site | `string` | `"datadoghq.com"` |
78-
| dd_tags | Custom tags for forwarded logs | `string` | `null` |
79-
| dd_trace_enabled | Enable trace forwarding | `bool` | `true` |
80-
| dd_enhanced_metrics | Enable enhanced Lambda metrics | `bool` | `false` |
72+
| Name | Description | Type | Default |
73+
| ----------------------------- | -------------------------------- | -------- | ----------------- |
74+
| dd_api_key | Datadog API key | `string` | `null` |
75+
| dd_api_key_secret_arn | ARN of secret storing API key | `string` | `null` |
76+
| dd_api_key_ssm_parameter_name | SSM parameter name for API key | `string` | `null` |
77+
| dd_site | Datadog site | `string` | `"datadoghq.com"` |
78+
| dd_tags | Custom tags for forwarded logs | `string` | `null` |
79+
| dd_source | Custom source for forwarded logs | `string` | `null` |
80+
| dd_trace_enabled | Enable trace forwarding | `bool` | `true` |
81+
| dd_enhanced_metrics | Enable enhanced Lambda metrics | `bool` | `false` |
8182

8283
### Tag Enrichment & Fetching
8384

main.tf

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -201,6 +201,7 @@ resource "aws_lambda_function" "forwarder" {
201201
# Optional environment variables
202202
{
203203
DD_TAGS = var.dd_tags
204+
DD_SOURCE = var.dd_source
204205
DD_ENRICH_S3_TAGS = var.dd_enrich_s3_tags != null ? tostring(var.dd_enrich_s3_tags) : null
205206
DD_ENRICH_CLOUDWATCH_TAGS = var.dd_enrich_cloudwatch_tags != null ? tostring(var.dd_enrich_cloudwatch_tags) : null
206207
DD_FETCH_LAMBDA_TAGS = var.dd_fetch_lambda_tags != null ? tostring(var.dd_fetch_lambda_tags) : null

variables.tf

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,12 @@ variable "dd_tags" {
119119
description = "Add custom tags to forwarded logs. Comma-delimited string without trailing comma, e.g., env:prod,stack:classic"
120120
}
121121

122+
variable "dd_source" {
123+
type = string
124+
default = null
125+
description = "Override the source attribute for all logs forwarded by Lambda Forwarder. By default, the Forwarder automatically detects the source based on the log origin (e.g., lambda, s3, cloudwatch, rds). When set, all logs will use the specified source value instead, and a source_overridden:true tag will be added to the logs."
126+
}
127+
122128
variable "dd_enrich_s3_tags" {
123129
type = bool
124130
default = null

0 commit comments

Comments
 (0)