DataDog / terraform-provider-datadog

Terraform Datadog provider
https://www.terraform.io/docs/providers/datadog/
Mozilla Public License 2.0
401 stars 376 forks source link

AWS integration included regions #2304

Open ggaugain opened 7 months ago

ggaugain commented 7 months ago

What resources or data sources are affected?

datadog_integration_aws

Feature Request

AWS regions to include from metrics collection. The excluded_regions requires a list to be maintained and does not automatically exclude data collection on a new AWS region.

Example of usage:

resource "datadog_integration_aws" "sandbox" { account_id = "1234567890" role_name = "DatadogAWSIntegrationRole" filter_tags = ["key:value"] host_tags = ["key:value", "key2:value2"] account_specific_namespace_rules = { auto_scaling = false opsworks = false } included_regions = ["us-east-1", "us-west-2"] }

References

No response

iniinikoski commented 6 months ago

This would definitely make sense.

hhughes0 commented 5 months ago

+1

ShaunKav commented 5 months ago

+1

knkcni commented 2 months ago

would be a great way to deal with new regions

danieljamesscott commented 1 month ago

This would be great as we're currently getting perpetual drift trying to exclude the new ap-southeast-5 region. It seems to submit the request to datadog with no problem, but then a subsequent plan shows that the change has not been applied.

fatbasstard commented 1 month ago

Well, we just solve this inverted (Based on the regions from the OP):

locals {
  excluded_dd_regions = setsubtract(data.aws_regions.current.names, "us-east-1", "us-west-2")
}

data "aws_regions" "current" {
  all_regions = true
}

resource "datadog_integration_aws" "default" {
  excluded_regions                     = var.excluded_regions
}
fatbasstard commented 1 month ago

@danieljamesscott Noticed this as well. Created an issue for that behaviour: https://github.com/DataDog/terraform-provider-datadog/issues/2548