-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathvariables.tf
More file actions
122 lines (104 loc) · 3.37 KB
/
variables.tf
File metadata and controls
122 lines (104 loc) · 3.37 KB
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
// variables.tf
variable "project_name" {
description = "Name of the project"
type = string
}
variable "environment" {
description = "Environment (e.g., prod, dev, test)"
type = string
}
variable "name_prefix" {
description = "Prefix for resource names (if not provided, will use project-environment pattern)"
type = string
default = ""
}
variable "tags" {
description = "Additional tags for all resources"
type = map(string)
default = {}
}
variable "ec2_instance_ids" {
description = "List of EC2 instance IDs to monitor"
type = list(string)
default = []
}
variable "ec2_high_cpu_threshold" {
description = "CPU utilization threshold for high CPU alarm (percentage)"
type = number
default = 80
}
variable "ec2_low_cpu_threshold" {
description = "CPU utilization threshold for low CPU alarm (percentage)"
type = number
default = 10
}
variable "enable_application_logs" {
description = "Enable application log group creation"
type = bool
default = true
}
variable "log_retention_days" {
description = "Number of days to retain logs in CloudWatch"
type = number
default = 30
validation {
condition = contains([1, 3, 5, 7, 14, 30, 60, 90, 120, 150, 180, 365, 400, 545, 731, 1827, 3653], var.log_retention_days)
error_message = "Log retention days must be one of: 1, 3, 5, 7, 14, 30, 60, 90, 120, 150, 180, 365, 400, 545, 731, 1827, 3653."
}
}
variable "log_group_kms_key_id" {
description = "The ARN of the KMS Key to use when encrypting log data"
type = string
default = ""
}
variable "sns_email_endpoints" {
description = "List of email addresses to subscribe to SNS topic"
type = list(string)
default = []
}
variable "alarm_evaluation_periods" {
description = "Number of periods over which data is compared to the threshold"
type = number
default = 2
}
variable "alarm_datapoints_to_alarm" {
description = "Number of datapoints that must be breaching to trigger the alarm"
type = number
default = 2
}
variable "alarm_period" {
description = "Period in seconds over which the statistic is applied"
type = number
default = 300
}
variable "enable_detailed_monitoring" {
description = "Enable detailed monitoring for EC2 instances"
type = bool
default = false
}
variable "custom_metrics" {
description = "Custom CloudWatch metrics to create alarms for"
type = map(object({
metric_name = string
namespace = string
threshold = number
statistic = optional(string, "Average")
comparison_operator = optional(string, "GreaterThanThreshold")
evaluation_periods = optional(number, 2)
datapoints_to_alarm = optional(number)
period = optional(number, 300)
description = optional(string, "")
dimensions = optional(map(string), {})
}))
default = {}
}
variable "enable_sns_encryption" {
description = "Enable encryption for SNS topic"
type = bool
default = true
}
variable "sns_kms_key_id" {
description = "KMS key ID for SNS topic encryption (if enable_sns_encryption=true)"
type = string
default = "alias/aws/sns"
}