103 lines
3.0 KiB
Markdown
Executable File
103 lines
3.0 KiB
Markdown
Executable File
# Terraform Datadog Slack Module
|
|
|
|
## Overview
|
|
|
|
This Terraform module creates a Kubernetes/Docker application monitoring dashboard in Datadog configured specifically for Slack/team deployments with account-scoped filtering.
|
|
|
|
## Features
|
|
|
|
- **Kubernetes Resource Monitoring**: Visualizes pod and node resource utilization
|
|
- **Account-Scoped Filtering**: Filters metrics by team and environment
|
|
- **CPU & Memory Tracking**: Timeseries visualization for top containers
|
|
- **Read-Only Dashboard**: Prevents accidental modifications
|
|
- **EU Datadog Instance**: Configured for European GDPR compliance
|
|
|
|
## Resources Created
|
|
|
|
- `datadog_dashboard`: Application monitoring dashboard with account-scoped widgets
|
|
|
|
## Dashboard Widgets
|
|
|
|
1. **Kubernetes Pods Hostmap**: CPU utilization by Docker image (account-scoped)
|
|
2. **CPU Utilization Timeseries**: Container CPU usage
|
|
3. **Kubernetes Nodes Hostmap**: CPU utilization by host
|
|
4. **Memory Utilization Timeseries**: Container memory usage
|
|
|
|
## Requirements
|
|
|
|
| Name | Version |
|
|
|------|---------|
|
|
| terraform | >= 0.12 |
|
|
| datadog | >= 3.5.0 |
|
|
|
|
## Usage
|
|
|
|
```hcl
|
|
module "slack_dashboard" {
|
|
source = "./terraform-datadog-slack"
|
|
|
|
opco_name = "sanoma"
|
|
app_name = "slack-integration"
|
|
team_name = "platform-team"
|
|
image_name = "slack-app"
|
|
aws_region = "eu-west-1"
|
|
env = "prd"
|
|
api_key = var.datadog_api_key
|
|
app_key = var.datadog_app_key
|
|
url = "https://slack.example.com/health"
|
|
}
|
|
```
|
|
|
|
## Inputs
|
|
|
|
| Name | Description | Type | Required |
|
|
|------|-------------|------|----------|
|
|
| `opco_name` | Name of the OPCO | `string` | yes |
|
|
| `app_name` | Name of the application | `string` | yes |
|
|
| `team_name` | Name of the responsible team | `string` | yes |
|
|
| `image_name` | Docker image name | `string` | yes |
|
|
| `aws_region` | AWS region for resources | `string` | yes |
|
|
| `env` | Environment (dev, tst, stg, prd) | `string` | yes |
|
|
| `api_key` | Datadog API key | `string` | yes |
|
|
| `app_key` | Datadog APP key | `string` | yes |
|
|
| `url` | Synthetics URL | `string` | yes |
|
|
|
|
## Outputs
|
|
|
|
Currently, this module does not export any outputs.
|
|
|
|
## Account Scoping
|
|
|
|
The dashboard filters metrics using account-based scoping:
|
|
- **Scope**: `account:{team_name}_{env}`
|
|
- This ensures each team only sees their environment's metrics
|
|
|
|
## Differences from terraform-datadog-app-dashboard
|
|
|
|
While similar to the app-dashboard module, this version:
|
|
- Uses account-scoped filtering instead of namespace
|
|
- Configured specifically for EU Datadog API
|
|
- Simplified widget set (no alert graph)
|
|
- Synthetics integration is commented out
|
|
- Uses OPCO name instead of CFA name
|
|
|
|
## Provider Configuration
|
|
|
|
- **API URL**: `https://api.datadoghq.eu` (EU instance)
|
|
- **Datadog Provider**: Version 3.5.0 or higher
|
|
|
|
## Notes
|
|
|
|
- Dashboard is read-only to prevent accidental modifications
|
|
- All widgets filter by account scope `{team_name}_{env}`
|
|
- Designed for multi-tenant Kubernetes environments
|
|
- Uses EU Datadog API endpoint for GDPR compliance
|
|
|
|
## License
|
|
|
|
Internal use only - Sanoma/WeBuildYourCloud
|
|
|
|
## Authors
|
|
|
|
Created and maintained by the Platform Engineering team.
|