generated from cloudposse/terraform-example-module
-
-
Notifications
You must be signed in to change notification settings - Fork 22
/
Copy pathapi_integrations.tf
24 lines (19 loc) · 932 Bytes
/
api_integrations.tf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
resource "opsgenie_api_integration" "this" {
for_each = module.this.enabled ? { for integration in local.api_integrations : integration.name => integration } : {}
name = each.value.name
type = each.value.type
dynamic "responders" {
for_each = try(each.value.responders, [])
content {
type = responders.value.type
id = responders.value.id
}
}
enabled = try(each.value.enabled, true)
allow_write_access = try(each.value.allow_write_access, true)
ignore_responders_from_payload = try(each.value.ignore_responders_from_payload, false)
suppress_notifications = try(each.value.suppress_notifications, false)
webhook_url = try(each.value.webhook_url, null)
# Look up our team id by name
owner_team_id = try(opsgenie_team.this[each.value.owner_team_name].id, data.opsgenie_team.this[each.value.owner_team_name].id, null)
}