Use this Terraform module to install Datadog monitoring for AWS Elastic Container Service tasks.
This Terraform module wraps the aws_ecs_task_definition resource and automatically configures your task definition for Datadog monitoring.
For more information on the ECS Fargate module, reference the submodule documentation.
For more information on the ECS on EC2 module, reference the submodule documentation.
If you encounter any issues, please open a GitHub issue to let us know.
module "datadog_ecs_fargate_task" {
source = "DataDog/ecs-datadog/aws//modules/ecs_fargate"
# Datadog Configuration
dd_api_key_secret = {
arn = "arn:aws:secretsmanager:us-east-1:0000000000:secret:example-secret"
}
dd_tags = "team:cont-p, owner:container-monitoring"
# Task Configuration
family = "example-app"
container_definitions = jsonencode([
{
name = "datadog-dogstatsd-app",
image = "ghcr.io/datadog/apps-dogstatsd:main",
}
])
}module "datadog_agent" {
source = "DataDog/ecs-datadog/aws//modules/ecs_ec2"
# Datadog Configuration
dd_api_key_secret = {
arn = "arn:aws:secretsmanager:us-east-1:0000000000:secret:example-secret"
}
dd_tags = "team:ecs-xp, owner:container-monitoring"
# Task Definition
family = "datadog-agent-daemon"
# Daemon Service
cluster_arn = "arn:aws:ecs:us-east-1:0000000000:cluster/my-cluster"
}