forked from cloudposse/terraform-datadog-platform
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathREADME.yaml
222 lines (167 loc) · 7.14 KB
/
README.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
---
#
# This is the canonical configuration for the `README.md`
# Run `make readme` to rebuild the `README.md`
#
# Name of this project
name: terraform-datadog-platform
# Tags of this project
tags:
- terraform
- terraform-modules
- monitor
- datadog
- monitoring
- synthetics
- rbac
- role
- permission
# Categories of this project
categories:
- terraform-modules/monitoring
# Logo for this project
#logo: docs/logo.png
# License of this project
license: "APACHE2"
# Canonical GitHub repo
github_repo: cloudposse/terraform-datadog-platform
# Badges to display
badges:
- name: "Latest Release"
image: "https://img.shields.io/github/release/cloudposse/terraform-datadog-platform.svg"
url: "https://github.com/cloudposse/terraform-datadog-platform/releases/latest"
- name: "Slack Community"
image: "https://slack.cloudposse.com/badge.svg"
url: "https://slack.cloudposse.com"
related:
- name: "terraform-aws-datadog-integration"
description: "Terraform module to configure Datadog AWS integration"
url: "https://github.com/cloudposse/terraform-aws-datadog-integration"
- name: "terraform-yaml-config"
description: "Terraform module to convert local and remote YAML configuration templates into Terraform lists and maps"
url: "https://github.com/cloudposse/terraform-yaml-config"
# Short description of this project
description: |-
Terraform module to provision Datadog resources.
The module consists of the following submodules:
- [monitors](modules/monitors) - to provision Datadog [monitors](https://docs.datadoghq.com/api/v1/monitors/)
- [synthetics](modules/synthetics) - to provision Datadog [synthetics](https://docs.datadoghq.com/synthetics/)
- [permissions](modules/permissions) - to look up all available Datadog [permissions](https://docs.datadoghq.com/account_management/rbac/permissions/)
- [roles](modules/roles) - to provision Datadog [roles](https://docs.datadoghq.com/account_management/rbac)
introduction: |-
Datadog resources (monitors, roles, etc.) are defined as [catalog](catalog) of YAML configuration files.
We maintain a comprehensive [catalog](catalog) of Datadog resources and welcome contributions via pull request!
The [examples/complete](examples/complete) in this module uses the catalog to provision the monitors on Datadog.
The [examples/synthetics](examples/synthetics) shows how to provision synthetics on Datadog for synthetic monitoring.
The [examples/rbac](examples/rbac) shows how to use custom RBAC to provision Datadog roles with permissions and assign roles to monitors.
references:
- name: "Terraform Datadog monitor resources"
description: "Provides a Datadog monitor resource. Used to create and manage Datadog monitors"
url: "https://registry.terraform.io/providers/DataDog/datadog/latest/docs/resources/monitor"
- name: "Create a monitor"
description: "Create datadog monitors"
url: "https://docs.datadoghq.com/api/v1/monitors/#create-a-monitor"
- name: "Terraform Datadog role resources"
description: "Provides a Datadog role resource. Used to create and manage Datadog roles"
url: "https://registry.terraform.io/providers/DataDog/datadog/latest/docs/resources/role"
- name: "Datadog permissions"
description: "Use this data source to retrieve the list of Datadog permissions by name and their corresponding ID, for use in the role resource"
url: "https://registry.terraform.io/providers/DataDog/datadog/latest/docs/data-sources/permissions"
- name: "Role Based Access Control"
description: "Roles categorize users and define what account permissions those users have, such as what data they can read or what account assets they can modify"
url: "https://docs.datadoghq.com/account_management/rbac"
# How to use this project
usage: |-
Provision Datadog monitors from the catalog of YAML definitions:
```hcl
module "monitor_configs" {
source = "cloudposse/config/yaml"
version = "0.8.1"
map_config_local_base_path = path.module
map_config_paths = var.monitor_paths
context = module.this.context
}
module "datadog_monitors" {
source = "cloudposse/platform/datadog//modules/monitors"
# version = "x.x.x"
datadog_monitors = module.monitor_configs.map_configs
alert_tags = var.alert_tags
alert_tags_separator = var.alert_tags_separator
context = module.this.context
}
```
Provision Datadog synthetics:
```hcl
module "synthetic_configs" {
source = "cloudposse/config/yaml"
version = "0.8.1"
map_config_local_base_path = path.module
map_config_paths = var.synthetic_paths
context = module.this.context
}
module "datadog_synthetics" {
source = "cloudposse/platform/datadog//modules/synthetics"
# version = "x.x.x"
datadog_synthetics = module.synthetic_configs.map_configs
alert_tags = var.alert_tags
alert_tags_separator = var.alert_tags_separator
context = module.this.context
}
```
Provision Datadog monitors, Datadog roles with defined permissions, and assign roles to monitors:
```hcl
module "monitor_configs" {
source = "cloudposse/config/yaml"
version = "0.8.1"
map_config_local_base_path = path.module
map_config_paths = var.monitor_paths
context = module.this.context
}
module "role_configs" {
source = "cloudposse/config/yaml"
version = "0.8.1"
map_config_local_base_path = path.module
map_config_paths = var.role_paths
context = module.this.context
}
locals {
monitors_write_role_name = module.datadog_roles.datadog_roles["monitors-write"].name
monitors_downtime_role_name = module.datadog_roles.datadog_roles["monitors-downtime"].name
monitors_roles_map = {
aurora-replica-lag = [local.monitors_write_role_name, local.monitors_downtime_role_name]
ec2-failed-status-check = [local.monitors_write_role_name, local.monitors_downtime_role_name]
redshift-health-status = [local.monitors_downtime_role_name]
k8s-deployment-replica-pod-down = [local.monitors_write_role_name]
}
}
module "datadog_roles" {
source = "cloudposse/platform/datadog//modules/roles"
# version = "x.x.x"
datadog_roles = module.role_configs.map_configs
context = module.this.context
}
module "datadog_monitors" {
source = "cloudposse/platform/datadog//modules/monitors"
# version = "x.x.x"
datadog_monitors = module.monitor_configs.map_configs
alert_tags = var.alert_tags
alert_tags_separator = var.alert_tags_separator
restricted_roles_map = local.monitors_roles_map
context = module.this.context
}
```
examples: |-
Review the [examples](examples) folder to see how to use the Datadog modules.
include:
- "docs/targets.md"
- "docs/terraform.md"
# Contributors to this project
contributors:
- name: "Erik Osterman"
github: "osterman"
- name: "Andriy Knysh"
github: "aknysh"
- name: "Vladimir"
github: "SweetOps"
- name: "Yonatan Koren"
github: "korenyoni"