Skip to content

Commit 452a995

Browse files
author
Art3mK
authored
feat(aws integration): add options to specify ignored regions and tags to filter out EC2 instances (#10)
1 parent d8eee56 commit 452a995

File tree

2 files changed

+16
-0
lines changed

2 files changed

+16
-0
lines changed

main.tf

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,15 @@ resource "datadog_integration_aws" "core" {
44
count = var.enable_datadog_aws_integration ? 1 : 0
55
account_id = var.aws_account_id
66
role_name = "datadog-integration-role"
7+
78
host_tags = [
89
"Namespace:${var.namespace}",
910
"env:${var.env}"
1011
]
12+
1113
account_specific_namespace_rules = var.account_specific_namespace_rules
14+
excluded_regions = var.excluded_regions
15+
filter_tags = var.filter_tags
1216
}
1317

1418
resource "aws_iam_role" "datadog-integration" {

vars.tf

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,3 +68,15 @@ variable "dd_forwarder_template_version" {
6868
type = string
6969
default = "3.13.0"
7070
}
71+
72+
variable "excluded_regions" {
73+
description = "An array of AWS regions to exclude from metrics collection"
74+
type = list(string)
75+
default = []
76+
}
77+
78+
variable "filter_tags" {
79+
description = "Array of EC2 tags (in the form key:value) defines a filter that Datadog use when collecting metrics from EC2. Wildcards, such as ? (for single characters) and * (for multiple characters) can also be used. Only hosts that match one of the defined tags will be imported into Datadog. The rest will be ignored."
80+
type = list(string)
81+
default = []
82+
}

0 commit comments

Comments
 (0)