File tree 5 files changed +27
-2
lines changed
5 files changed +27
-2
lines changed Original file line number Diff line number Diff line change
1
+
2
+ Combine lambdas into 1
3
+ - determine which integration to setup by parsing event data
Original file line number Diff line number Diff line change
1
+ module "enabled" {
2
+ source = " devops-workflow/boolean/local"
3
+ version = " 0.1.2"
4
+ value = " ${ var . enabled } "
5
+ }
6
+
1
7
locals {
2
- enabled = " ${ length (var. service_key ) > 0 ? 1 : 0 } "
8
+ enabled = " ${ module . enabled . value && length (var. service_key ) > 0 ? 1 : 0 } "
3
9
}
4
10
5
11
data "template_file" "pagerduty_service" {
Original file line number Diff line number Diff line change @@ -3,6 +3,11 @@ variable "datadog_default" {
3
3
default = " "
4
4
}
5
5
6
+ variable "enabled" {
7
+ description = " Set to false to prevent the module from creating anything"
8
+ default = true
9
+ }
10
+
6
11
variable "service_key" {
7
12
description = " PagerDuty service integration key"
8
13
default = " "
Original file line number Diff line number Diff line change 3
3
# Channel name is empty
4
4
# Channel name has format mon-<env>-<service short name> but nothing after second -
5
5
6
+ module "enabled" {
7
+ source = " devops-workflow/boolean/local"
8
+ version = " 0.1.2"
9
+ value = " ${ var . enabled } "
10
+ }
11
+
6
12
locals {
7
- enabled = " ${ length (replace (var. channel_name , " /(mon-\\ w+-)(.*)$/" , " $2" )) > 0 ? 1 : 0 } "
13
+ enabled = " ${ module . enabled . value && length (replace (var. channel_name , " /(mon-\\ w+-)(.*)$/" , " $2" )) > 0 ? 1 : 0 } "
8
14
}
9
15
10
16
data "template_file" "slack_channel" {
Original file line number Diff line number Diff line change @@ -3,6 +3,11 @@ variable "channel_name" {
3
3
default = " "
4
4
}
5
5
6
+ variable "enabled" {
7
+ description = " Set to false to prevent the module from creating anything"
8
+ default = true
9
+ }
10
+
6
11
variable "s3_base" {
7
12
description = " Base path in S3 bucket for Slack configuration pieces"
8
13
default = " datadog/integration/slack"
You can’t perform that action at this time.
0 commit comments