Skip to content

Commit 56d6bcd

Browse files
authored
update 'datadog-lambda-forwarder' v1.3.0 (cloudposse/terraform-aws-components#601)
1 parent 60ab82d commit 56d6bcd

File tree

3 files changed

+40
-4
lines changed

3 files changed

+40
-4
lines changed

src/README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ components:
6464
|------|--------|---------|
6565
| <a name="module_datadog-integration"></a> [datadog-integration](#module\_datadog-integration) | cloudposse/stack-config/yaml//modules/remote-state | 1.4.1 |
6666
| <a name="module_datadog_configuration"></a> [datadog\_configuration](#module\_datadog\_configuration) | ../datadog-configuration/modules/datadog_keys | n/a |
67-
| <a name="module_datadog_lambda_forwarder"></a> [datadog\_lambda\_forwarder](#module\_datadog\_lambda\_forwarder) | cloudposse/datadog-lambda-forwarder/aws | 1.2.0 |
67+
| <a name="module_datadog_lambda_forwarder"></a> [datadog\_lambda\_forwarder](#module\_datadog\_lambda\_forwarder) | cloudposse/datadog-lambda-forwarder/aws | 1.3.0 |
6868
| <a name="module_iam_roles"></a> [iam\_roles](#module\_iam\_roles) | ../account-map/modules/iam-roles | n/a |
6969
| <a name="module_log_group_prefix"></a> [log\_group\_prefix](#module\_log\_group\_prefix) | cloudposse/label/null | 0.25.0 |
7070
| <a name="module_this"></a> [this](#module\_this) | cloudposse/label/null | 0.25.0 |
@@ -84,6 +84,7 @@ components:
8484
|------|-------------|------|---------|:--------:|
8585
| <a name="input_additional_tag_map"></a> [additional\_tag\_map](#input\_additional\_tag\_map) | Additional key-value pairs to add to each map in `tags_as_list_of_maps`. Not added to `tags` or `id`.<br>This is for some rare cases where resources want additional configuration of tags<br>and therefore take a list of maps with tag key, value, and additional configuration. | `map(string)` | `{}` | no |
8686
| <a name="input_attributes"></a> [attributes](#input\_attributes) | ID element. Additional attributes (e.g. `workers` or `cluster`) to add to `id`,<br>in the order they appear in the list. New attributes are appended to the<br>end of the list. The elements of the list are joined by the `delimiter`<br>and treated as a single ID element. | `list(string)` | `[]` | no |
87+
| <a name="input_cloudwatch_forwarder_event_patterns"></a> [cloudwatch\_forwarder\_event\_patterns](#input\_cloudwatch\_forwarder\_event\_patterns) | Map of title => CloudWatch Event patterns to forward to Datadog. Event structure from here: <https://docs.aws.amazon.com/AmazonCloudWatch/latest/events/CloudWatchEventsandEventPatterns.html#CloudWatchEventsPatterns><br>Example:<pre>hcl<br>cloudwatch_forwarder_event_rules = {<br> "guardduty" = {<br> source = ["aws.guardduty"]<br> detail-type = ["GuardDuty Finding"]<br> }<br> "ec2-terminated" = {<br> source = ["aws.ec2"]<br> detail-type = ["EC2 Instance State-change Notification"]<br> detail = {<br> state = ["terminated"]<br> }<br> }<br>}</pre> | <pre>map(object({<br> version = optional(list(string))<br> id = optional(list(string))<br> detail-type = optional(list(string))<br> source = optional(list(string))<br> account = optional(list(string))<br> time = optional(list(string))<br> region = optional(list(string))<br> resources = optional(list(string))<br> detail = optional(map(list(string)))<br> }))</pre> | `{}` | no |
8788
| <a name="input_cloudwatch_forwarder_log_groups"></a> [cloudwatch\_forwarder\_log\_groups](#input\_cloudwatch\_forwarder\_log\_groups) | Map of CloudWatch Log Groups with a filter pattern that the Lambda forwarder will send logs from. For example: { mysql1 = { name = "/aws/rds/maincluster", filter\_pattern = "" } | `map(map(string))` | `{}` | no |
8889
| <a name="input_context"></a> [context](#input\_context) | Single object for setting entire context at once.<br>See description of individual variables for details.<br>Leave string and numeric variables as `null` to use default value.<br>Individual variable settings (non-null) override settings in context object,<br>except for attributes, tags, and additional\_tag\_map, which are merged. | `any` | <pre>{<br> "additional_tag_map": {},<br> "attributes": [],<br> "delimiter": null,<br> "descriptor_formats": {},<br> "enabled": true,<br> "environment": null,<br> "id_length_limit": null,<br> "label_key_case": null,<br> "label_order": [],<br> "label_value_case": null,<br> "labels_as_tags": [<br> "unset"<br> ],<br> "name": null,<br> "namespace": null,<br> "regex_replace_chars": null,<br> "stage": null,<br> "tags": {},<br> "tenant": null<br>}</pre> | no |
8990
| <a name="input_context_tags"></a> [context\_tags](#input\_context\_tags) | List of context tags to add to each monitor | `set(string)` | <pre>[<br> "namespace",<br> "tenant",<br> "environment",<br> "stage"<br>]</pre> | no |

src/main.tf

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,10 +40,11 @@ module "log_group_prefix" {
4040

4141
module "datadog_lambda_forwarder" {
4242
source = "cloudposse/datadog-lambda-forwarder/aws"
43-
version = "1.2.0"
43+
version = "1.3.0"
4444

45-
cloudwatch_forwarder_log_groups = local.cloudwatch_forwarder_log_groups
46-
dd_api_key_kms_ciphertext_blob = var.dd_api_key_kms_ciphertext_blob
45+
cloudwatch_forwarder_log_groups = local.cloudwatch_forwarder_log_groups
46+
cloudwatch_forwarder_event_patterns = var.cloudwatch_forwarder_event_patterns
47+
dd_api_key_kms_ciphertext_blob = var.dd_api_key_kms_ciphertext_blob
4748
dd_api_key_source = {
4849
resource = lower(module.datadog_configuration.datadog_secrets_store_type)
4950
identifier = module.datadog_configuration.datadog_api_key_location

src/variables.tf

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,40 @@ variable "cloudwatch_forwarder_log_groups" {
114114
default = {}
115115
}
116116

117+
variable "cloudwatch_forwarder_event_patterns" {
118+
type = map(object({
119+
version = optional(list(string))
120+
id = optional(list(string))
121+
detail-type = optional(list(string))
122+
source = optional(list(string))
123+
account = optional(list(string))
124+
time = optional(list(string))
125+
region = optional(list(string))
126+
resources = optional(list(string))
127+
detail = optional(map(list(string)))
128+
}))
129+
description = <<-EOF
130+
Map of title => CloudWatch Event patterns to forward to Datadog. Event structure from here: <https://docs.aws.amazon.com/AmazonCloudWatch/latest/events/CloudWatchEventsandEventPatterns.html#CloudWatchEventsPatterns>
131+
Example:
132+
```hcl
133+
cloudwatch_forwarder_event_rules = {
134+
"guardduty" = {
135+
source = ["aws.guardduty"]
136+
detail-type = ["GuardDuty Finding"]
137+
}
138+
"ec2-terminated" = {
139+
source = ["aws.ec2"]
140+
detail-type = ["EC2 Instance State-change Notification"]
141+
detail = {
142+
state = ["terminated"]
143+
}
144+
}
145+
}
146+
```
147+
EOF
148+
default = {}
149+
}
150+
117151
variable "forwarder_lambda_debug_enabled" {
118152
type = bool
119153
description = "Whether to enable or disable debug for the Lambda forwarder"

0 commit comments

Comments
 (0)