-
Notifications
You must be signed in to change notification settings - Fork 4
/
cloudwatch-metric-alarms.tf
153 lines (143 loc) · 6.55 KB
/
cloudwatch-metric-alarms.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
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
resource "aws_cloudwatch_metric_alarm" "S3BucketActivity" {
alarm_name = "CloudTrailS3BucketActivity"
comparison_operator = "GreaterThanOrEqualToThreshold"
evaluation_periods = "1"
metric_name = "S3BucketActivityEventCount"
namespace = "CloudTrailMetrics"
period = "300"
statistic = "Sum"
threshold = "1"
treat_missing_data = "notBreaching"
alarm_actions = ["${aws_sns_topic.sns_topic_default.arn}"]
alarm_description = "Alarms when an API call is made to S3 to put or delete a Bucket, Bucket Policy or Bucket ACL."
}
resource "aws_cloudwatch_metric_alarm" "CloudTrailSecurityGroupChanges" {
alarm_name = "CloudTrailSecurityGroupChanges"
comparison_operator = "GreaterThanOrEqualToThreshold"
evaluation_periods = "1"
metric_name = "SecurityGroupEventCount"
namespace = "CloudTrailMetrics"
period = "300"
statistic = "Sum"
threshold = "1"
treat_missing_data = "notBreaching"
alarm_actions = ["${aws_sns_topic.sns_topic_default.arn}"]
alarm_description = "Alarms when an API call is made to create, update or delete a Security Group."
}
resource "aws_cloudwatch_metric_alarm" "CloudTrailNetworkAclChanges" {
alarm_name = "CloudTrailNetworkAclChanges"
comparison_operator = "GreaterThanOrEqualToThreshold"
evaluation_periods = "1"
metric_name = "NetworkAclEventCount"
namespace = "CloudTrailMetrics"
period = "300"
statistic = "Sum"
threshold = "1"
treat_missing_data = "notBreaching"
alarm_actions = ["${aws_sns_topic.sns_topic_default.arn}"]
alarm_description = "Alarms when an API call is made to create, update or delete a Network ACL."
}
resource "aws_cloudwatch_metric_alarm" "CloudTrailGatewayChanges" {
alarm_name = "CloudTrailGatewayChanges"
comparison_operator = "GreaterThanOrEqualToThreshold"
evaluation_periods = "1"
metric_name = "GatewayEventCount"
namespace = "CloudTrailMetrics"
period = "300"
statistic = "Sum"
threshold = "1"
treat_missing_data = "notBreaching"
alarm_actions = ["${aws_sns_topic.sns_topic_default.arn}"]
alarm_description = "Alarms when an API call is made to create, update or delete a Customer or Internet Gateway."
}
resource "aws_cloudwatch_metric_alarm" "CloudTrailVpcChanges" {
alarm_name = "CloudTrailVpcChanges"
comparison_operator = "GreaterThanOrEqualToThreshold"
evaluation_periods = "1"
metric_name = "VpcEventCount"
namespace = "CloudTrailMetrics"
period = "300"
statistic = "Sum"
threshold = "1"
treat_missing_data = "notBreaching"
alarm_actions = ["${aws_sns_topic.sns_topic_default.arn}"]
alarm_description = "Alarms when an API call is made to create, update or delete a VPC, VPC peering connection or VPC connection to classic."
}
resource "aws_cloudwatch_metric_alarm" "CloudTrailEC2InstanceChanges" {
alarm_name = "CloudTrailEC2InstanceChanges"
comparison_operator = "GreaterThanOrEqualToThreshold"
evaluation_periods = "1"
metric_name = "EC2InstanceEventCount"
namespace = "CloudTrailMetrics"
period = "300"
statistic = "Sum"
threshold = "1"
treat_missing_data = "notBreaching"
alarm_actions = ["${aws_sns_topic.sns_topic_default.arn}"]
alarm_description = "Alarms when an API call is made to create, terminate, start, stop or reboot an EC2 instance."
}
resource "aws_cloudwatch_metric_alarm" "CloudTrailEC2LargeInstanceChanges" {
alarm_name = "CloudTrailEC2LargeInstanceChanges"
comparison_operator = "GreaterThanOrEqualToThreshold"
evaluation_periods = "1"
metric_name = "EC2LargeInstanceEventCount"
namespace = "CloudTrailMetrics"
period = "300"
statistic = "Sum"
threshold = "1"
treat_missing_data = "notBreaching"
alarm_actions = ["${aws_sns_topic.sns_topic_default.arn}"]
alarm_description = "Alarms when an API call is made to create, terminate, start, stop or reboot a 4x or 8x-large EC2 instance."
}
resource "aws_cloudwatch_metric_alarm" "CloudTrailChanges" {
alarm_name = "CloudTrailChanges"
comparison_operator = "GreaterThanOrEqualToThreshold"
evaluation_periods = "1"
metric_name = "CloudTrailEventCount"
namespace = "CloudTrailMetrics"
period = "300"
statistic = "Sum"
threshold = "1"
treat_missing_data = "notBreaching"
alarm_actions = ["${aws_sns_topic.sns_topic_default.arn}"]
alarm_description = "Alarms when an API call is made to create, update or delete a .cloudtrail. trail, or to start or stop logging to a trail."
}
resource "aws_cloudwatch_metric_alarm" "CloudTrailConsoleSignInFailures" {
alarm_name = "CloudTrailConsoleSignInFailures"
comparison_operator = "GreaterThanOrEqualToThreshold"
evaluation_periods = "1"
metric_name = "ConsoleSignInFailureCount"
namespace = "CloudTrailMetrics"
period = "300"
statistic = "Sum"
threshold = "3"
treat_missing_data = "notBreaching"
alarm_actions = ["${aws_sns_topic.sns_topic_default.arn}"]
alarm_description = "Alarms when an unauthenticated API call is made to sign into the console."
}
resource "aws_cloudwatch_metric_alarm" "CloudTrailAuthorizationFailures" {
alarm_name = "CloudTrailAuthorizationFailures"
comparison_operator = "GreaterThanOrEqualToThreshold"
evaluation_periods = "1"
metric_name = "AuthorizationFailureCount"
namespace = "CloudTrailMetrics"
period = "300"
statistic = "Sum"
threshold = "1"
treat_missing_data = "notBreaching"
alarm_actions = ["${aws_sns_topic.sns_topic_default.arn}"]
alarm_description = "Alarms when an unauthorized API call is made."
}
resource "aws_cloudwatch_metric_alarm" "CloudTrailIAMPolicyChanges" {
alarm_name = "CloudTrailIAMPolicyChanges"
comparison_operator = "GreaterThanOrEqualToThreshold"
evaluation_periods = "1"
metric_name = "IAMPolicyEventCount"
namespace = "CloudTrailMetrics"
period = "300"
statistic = "Sum"
threshold = "1"
treat_missing_data = "notBreaching"
alarm_actions = ["${aws_sns_topic.sns_topic_default.arn}"]
alarm_description = "Alarms when an API call is made to change an IAM policy."
}