Terraform module for AWS integration in Datadog to gather data from AWS services and billing.
NOTE: The module will only execute if an external_id
is given. You receive
these by going to 'Integrations' in Datadog, click 'Configure' on 'Amazon Web
Services' and either click 'Add another account' or 'Generate new ID' for an
existing account.
NOTE: This can increase the costs on Datadog and AWS heavilly. Only include AWS services you need to track in Datadog and use tags.
This project is internal open source and currently maintained by the INF.
The following requirements are needed by this module:
- terraform (>= 0.12)
The following providers are used by this module:
- aws
No required input.
The following input variables are optional (have default values):
Description: Provide the Datadog integration with a custom set of permissions to limit or expand data collection (see docs)
Type: string
Default: ""
Description: 'AWS External ID' from the integration settings dialog in Datadog
Type: string
Default: ""
Description: common tags to add to the ressources
Type: map(string)
Default: {}
No output.
Add your AWS account in Datadog:
- Insert account ID
- Keep role name to the default (
DatadogAWSIntegrationRole
) - Copy the
AWS External ID
and supply it to the module asexternal_id
- Add a comma separated list of tags (should at least contain squad and environment)
- Optionally: limit collection to specific tagged hosts
- Select namespace rules you want to collect metrics from
Add following code snippet to your stack
module "datadog" {
source = "github.com/ryte/INF-tf-datadog.git?ref=v0.2.1"
tags = local.common_tags
external_id = "$yourAWSExternalIDinDatadog"
}
or with a custom set of permissions
data "aws_iam_policy_document" "custom_policy" {
statement {
actions = ["budgets:ViewBudget"]
resources = ["*"]
}
}
module "datadog" {
source = "github.com/ryte/INF-tf-datadog.git?ref=v0.2.1"
tags = local.common_tags
external_id = "$yourAWSExternalIDinDatadog"
custom_policy = data.aws_iam_policy_document.custom_policy.json
}
- 0.2.1 - Add tags to role
- 0.2.0 - Upgrade to terraform v0.12
- 0.1.0 - Initial release.
This software is released under the MIT License (see LICENSE
).