File tree Expand file tree Collapse file tree 11 files changed +53
-3
lines changed Expand file tree Collapse file tree 11 files changed +53
-3
lines changed Original file line number Diff line number Diff line change
1
+ module "service" {
2
+ source = " ../../modules/pagerduty"
3
+ service_key = " "
4
+ service_name = " testing_disable_tf"
5
+ s3_bucket = " wiser-infra-automation"
6
+ }
Original file line number Diff line number Diff line change
1
+ provider "aws" {
2
+ region = " us-west-2"
3
+
4
+ # Make it faster by skipping something
5
+ skip_get_ec2_platforms = true
6
+ skip_metadata_api_check = true
7
+ skip_region_validation = true
8
+ skip_credentials_validation = true
9
+ skip_requesting_account_id = true
10
+ }
Original file line number Diff line number Diff line change @@ -2,5 +2,5 @@ module "service" {
2
2
source = " ../../modules/pagerduty"
3
3
service_key = " 123456789012"
4
4
service_name = " test-srv-2"
5
- s3_bucket = " wiser-one-ci "
5
+ s3_bucket = " wiser-infra-automation "
6
6
}
Original file line number Diff line number Diff line change 1
1
module "channel" {
2
2
source = " ../../modules/slack"
3
3
channel_name = " test-srv-1a"
4
- s3_bucket = " wiser-one-ci "
4
+ s3_bucket = " wiser-infra-automation "
5
5
}
Original file line number Diff line number Diff line change 1
1
module "channel" {
2
2
source = " ../../modules/slack"
3
3
channel_name = " test-srv-2"
4
- s3_bucket = " wiser-one-ci "
4
+ s3_bucket = " wiser-infra-automation "
5
5
}
Original file line number Diff line number Diff line change
1
+ module "channel" {
2
+ source = " ../../modules/slack"
3
+ channel_name = " "
4
+ s3_bucket = " wiser-infra-automation"
5
+ }
Original file line number Diff line number Diff line change
1
+ provider "aws" {
2
+ region = " us-west-2"
3
+
4
+ # Make it faster by skipping something
5
+ skip_get_ec2_platforms = true
6
+ skip_metadata_api_check = true
7
+ skip_region_validation = true
8
+ skip_credentials_validation = true
9
+ skip_requesting_account_id = true
10
+ }
Original file line number Diff line number Diff line change
1
+ locals {
2
+ enabled = " ${ length (var. service_key ) > 0 ? 1 : 0 } "
3
+ }
4
+
1
5
data "template_file" "pagerduty_service" {
6
+ count = " ${ local . enabled } "
2
7
template = " ${ file (" ${ path . module } /templates/pagerduty.json" )} "
3
8
4
9
vars {
@@ -9,6 +14,7 @@ data "template_file" "pagerduty_service" {
9
14
}
10
15
11
16
resource "aws_s3_bucket_object" "object" {
17
+ count = " ${ local . enabled } "
12
18
bucket = " ${ var . s3_bucket } "
13
19
acl = " bucket-owner-full-control"
14
20
Original file line number Diff line number Diff line change @@ -5,6 +5,7 @@ variable "datadog_default" {
5
5
6
6
variable "service_key" {
7
7
description = " PagerDuty service integration key"
8
+ default = " "
8
9
}
9
10
10
11
variable "service_name" {
Original file line number Diff line number Diff line change
1
+ # Expect Slack channel name to be of format: mon-<env>-<service short name>
2
+ # Auto disable if:
3
+ # Channel name is empty
4
+ # Channel name has format mon-<env>-<service short name> but nothing after second -
5
+
6
+ locals {
7
+ enabled = " ${ length (replace (var. channel_name , " /(mon-\\ w+-)(.*)$/" , " $2" )) > 0 ? 1 : 0 } "
8
+ }
9
+
1
10
data "template_file" "slack_channel" {
11
+ count = " ${ local . enabled } "
2
12
template = " ${ file (" ${ path . module } /templates/slack.json" )} "
3
13
4
14
vars {
@@ -7,6 +17,7 @@ data "template_file" "slack_channel" {
7
17
}
8
18
9
19
resource "aws_s3_bucket_object" "object" {
20
+ count = " ${ local . enabled } "
10
21
bucket = " ${ var . s3_bucket } "
11
22
acl = " bucket-owner-full-control"
12
23
You can’t perform that action at this time.
0 commit comments