This repository aims to help to configure Datadog integrations using Terraform modules.
- This repository provide multiple Terraform modules which could be imported, you must choose the one(s) you need.
- Each module should be usable by default but you should be able to configure some specicities if you need.
- You will find a complete
README.md
on each module, explaining how to use it.
Here is the minimum versions required to use these modules of integrations.
required_providers {
datadog = {
source = "DataDog/datadog"
version = ">= 3.0.0"
}
}
required_version = ">= 0.12.31"
}
Note: if you want to use Datadog provider v2 so you need to use version 3 of this repository.
Here is the last tested terraform provider version for datadog but next versions should work too.
provider "datadog" {
api_key = var.datadog_api_key
app_key = var.datadog_app_key
}
Both of the datadog_api_key
and datadog_app_key
are unique to the each datadog account. You can define them in terraform.tfvars
file:
datadog_api_key = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
datadog_app_key = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
Some variables need to be declared.
variable "environment" {
type = string
default = "dev"
}
variable "datadog_api_key" {
type = string
}
variable "datadog_app_key" {
type = string
}
# integrations modules to declare ...
module "datadog-my-integration" {
source = "claranet/integrations/datadog//my/integration/set"
version = "{revision}"
# Rest of configuration will depends on each module, please see its README.md
}
- Replace
{revision}
to the last git tag available on this repository. - The
//
is very important, it's a terraform specific syntax used to separate git url and folder path. my/integration
represents the path to an integration directory listed below.
Contributions are always welcome.
The easiest way is to fork the repository, duplicate a module as "template" and work on it.
An internal CI will run the auto_update.sh
script to compare with proposed changes and check if everything is up to date.
So, when PR is ready you will need to run this script and push its changes to pass the CI, see scripts repository for more information.
For example, this will regenerate every READMEs thanks to terraform-docs currently in v0.9.1.