Skip to content

Commit 3edea2d

Browse files
authored
add example SNS topic for cloudwatch alarm actions (#14)
1 parent 0bb5e14 commit 3edea2d

File tree

1 file changed

+13
-5
lines changed

1 file changed

+13
-5
lines changed

example/main.tf

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,10 @@ locals {
66
]
77
}
88

9+
resource "aws_sns_topic" "this" {
10+
name = "alarms_topic"
11+
}
12+
913
module "dashboard" {
1014
source = "../modules/dashboard"
1115
regions = local.regions
@@ -16,32 +20,36 @@ module "dashboard" {
1620
}
1721

1822
module "trusted_advisor_alarms" {
19-
source = "../modules/trusted_advisor_alarms"
20-
regions = local.regions
23+
source = "../modules/trusted_advisor_alarms"
24+
regions = local.regions
25+
cloudwatch_alarm_actions = [aws_sns_topic.this.arn]
2126

2227
providers = {
2328
aws = aws.us-east-1
2429
}
2530
}
2631

2732
module "usage_alarms_ap_southeast_1" {
28-
source = "../modules/usage_alarms"
33+
source = "../modules/usage_alarms"
34+
cloudwatch_alarm_actions = [aws_sns_topic.this.arn]
2935

3036
providers = {
3137
aws = aws.ap-southeast-1
3238
}
3339
}
3440

3541
module "usage_alarms_eu_west_1" {
36-
source = "../modules/usage_alarms"
42+
source = "../modules/usage_alarms"
43+
cloudwatch_alarm_actions = [aws_sns_topic.this.arn]
3744

3845
providers = {
3946
aws = aws.eu-west-1
4047
}
4148
}
4249

4350
module "usage_alarms_us_east_1" {
44-
source = "../modules/usage_alarms"
51+
source = "../modules/usage_alarms"
52+
cloudwatch_alarm_actions = [aws_sns_topic.this.arn]
4553

4654
providers = {
4755
aws = aws.us-east-1

0 commit comments

Comments
 (0)