generated from cloudposse/terraform-example-module
-
-
Notifications
You must be signed in to change notification settings - Fork 18
/
variables.tf
254 lines (219 loc) · 9.8 KB
/
variables.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
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
variable "scan_maintenance_window_duration" {
description = "The duration of the maintenence windows (hours)"
type = number
default = 3
}
variable "scan_maintenance_window_cutoff" {
description = "The number of hours before the end of the Maintenance Window that Systems Manager stops scheduling new tasks for execution"
type = number
default = 1
}
variable "install_maintenance_window_duration" {
description = "The duration of the maintenence windows (hours)"
type = number
default = 3
}
variable "install_maintenance_window_cutoff" {
description = "The number of hours before the end of the Maintenance Window that Systems Manager stops scheduling new tasks for execution"
type = number
default = 1
}
variable "max_concurrency" {
description = "The maximum number of targets this task can be run for in parallel"
type = number
default = 20
}
variable "max_errors" {
description = "The maximum number of errors allowed before this task stops being scheduled"
type = number
default = 50
}
variable "service_role_arn" {
description = "The role that should be assumed when executing the task. If a role is not provided, Systems Manager uses your account's service-linked role. If no service-linked role for Systems Manager exists in your account, it is created for you"
type = string
default = null
}
variable "reboot_option" {
description = "When you choose the RebootIfNeeded option, the instance is rebooted if Patch Manager installed new patches, or if it detected any patches with a status of INSTALLED_PENDING_REBOOT during the Install operation. Possible values : RebootIfNeeded, NoReboot"
type = string
default = "RebootIfNeeded"
}
variable "notification_events" {
description = "The different events for which you can receive notifications. Valid values: All, InProgress, Success, TimedOut, Cancelled, and Failed"
type = list(string)
default = ["All"]
}
variable "notification_type" {
description = "When specified with Command, receive notification when the status of a command changes. When specified with Invocation, for commands sent to multiple instances, receive notification on a per-instance basis when the status of a command changes. Valid values: Command and Invocation"
type = string
default = "Command"
}
variable "notification_arn" {
description = "An Amazon Resource Name (ARN) for a Simple Notification Service (SNS) topic. Run Command pushes notifications about command status changes to this topic."
type = string
default = ""
}
variable "sns_notification_role_arn" {
description = "An Amazon Resource Name (ARN) for a Simple Notification Service (SNS) topic. Run Command pushes notifications about command status changes to this topic."
type = string
default = ""
}
variable "scan_patch_groups" {
description = "The targets to register with the maintenance window. In other words, the instances to run commands on when the maintenance window runs. You can specify targets using instance IDs, resource group names, or tags that have been applied to instances. For more information about these examples formats see (https://docs.aws.amazon.com/systems-manager/latest/userguide/mw-cli-tutorial-targets-examples.html)"
type = list(string)
default = ["TOSCAN"]
}
variable "scan_maintenance_window_schedule" {
description = "The schedule of the Maintenance Window in the form of a cron or rate expression."
type = string
default = "cron(0 0 18 ? * WED *)"
}
variable "task_scan_priority" {
description = "The priority of the task in the Maintenance Window, the lower the number the higher the priority. Tasks in a Maintenance Window are scheduled in priority order with tasks that have the same priority scheduled in parallel. Default 1"
type = number
default = 1
}
variable "scan_sns_notification_enabled" {
description = "Enable/Disable the SNS notification for scans"
type = bool
default = false
}
variable "scan_maintenance_windows_targets" {
description = "The map of tags for targetting which EC2 instances will be scaned"
type = list(object({
key : string
values : list(string)
}
)
)
default = []
}
variable "install_patch_groups" {
description = "The targets to register with the maintenance window. In other words, the instances to run commands on when the maintenance window runs. You can specify targets using instance IDs, resource group names, or tags that have been applied to instances. For more information about these examples formats see (https://docs.aws.amazon.com/systems-manager/latest/userguide/mw-cli-tutorial-targets-examples.html)"
type = list(string)
default = ["TOPATCH"]
}
variable "install_maintenance_window_schedule" {
description = "The schedule of the Maintenance Window in the form of a cron or rate expression"
type = string
default = "cron(0 0 21 ? * WED *)"
}
variable "s3_bucket_prefix_install_logs" {
description = "The Amazon S3 bucket subfolder for install logs"
type = string
default = "install"
}
variable "s3_bucket_prefix_scan_logs" {
description = "The Amazon S3 bucket subfolder for scan logs"
type = string
default = "scanning"
}
variable "task_install_priority" {
description = "The priority of the task in the Maintenance Window, the lower the number the higher the priority. Tasks in a Maintenance Window are scheduled in priority order with tasks that have the same priority scheduled in parallel."
type = number
default = 1
}
variable "install_sns_notification_enabled" {
description = "Enable/disable the SNS notification for install patches"
type = bool
default = false
}
variable "install_maintenance_windows_targets" {
description = "The targets to register with the maintenance window. In other words, the instances to run commands on when the maintenance window runs. You can specify targets using instance IDs, resource group names, or tags that have been applied to instances. For more information about these examples formats see (https://docs.aws.amazon.com/systems-manager/latest/userguide/mw-cli-tutorial-targets-examples.html)"
type = list(object({
key : string
values : list(string)
}
)
)
default = []
}
variable "operating_system" {
description = "Defines the operating system the patch baseline applies to. Supported operating systems include WINDOWS, AMAZON_LINUX, AMAZON_LINUX_2, SUSE, UBUNTU, CENTOS, and REDHAT_ENTERPRISE_LINUX. The Default value is WINDOWS."
type = string
default = "AMAZON_LINUX_2"
}
variable "approved_patches" {
description = "A list of explicitly approved patches for the baseline"
type = list(string)
default = []
}
variable "rejected_patches" {
description = "A list of rejected patches"
type = list(string)
default = []
}
variable "patch_baseline_approval_rules" {
description = <<EOT
A set of rules used to include patches in the baseline. Up to 10 approval rules can be specified.
Each `approval_rule` block requires the fields documented below (unless marked optional).
`approve_after_days` and `approve_until_date` conflict, do not set both in the same `approval_rule`.
See https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/ssm_patch_baseline#approval_rule-block for full details.
EOT
type = list(object({
approve_after_days : optional(number)
approve_until_date : optional(string)
compliance_level : string
enable_non_security : bool
patch_baseline_filters : list(object({
name : string
values : list(string)
}))
}))
default = [
{
approve_after_days = 7
compliance_level = "HIGH"
enable_non_security = true
patch_baseline_filters = [
{
name = "PRODUCT"
values = ["AmazonLinux2", "AmazonLinux2.0"]
},
{
name = "CLASSIFICATION"
values = ["Security", "Bugfix", "Recommended"]
},
{
name = "SEVERITY"
values = ["Critical", "Important", "Medium"]
}
]
}
]
}
variable "approved_patches_compliance_level" {
type = string
description = "Defines the compliance level for approved patches. This means that if an approved patch is reported as missing, this is the severity of the compliance violation. Valid compliance levels include the following: CRITICAL, HIGH, MEDIUM, LOW, INFORMATIONAL, UNSPECIFIED. The default value is UNSPECIFIED."
default = "HIGH"
}
variable "ssm_bucket_policy" {
type = string
description = "Custom bucket policy for the SSM log bucket"
default = null
}
variable "bucket_id" {
type = list(string)
description = "The bucket ID to use for the patch log. If no bucket ID is provided, the module will create a new one. This is of type `list(string)` to work around #41 / https://github.com/hashicorp/terraform/issues/28962."
default = []
}
variable "ssm_bucket_versioning_enable" {
type = string
description = "To enable or disable S3 bucket versioning for the log bucket."
default = true
}
variable "s3_log_output_enabled" {
type = bool
description = "To enable or disable s3 bucket output for the runCommand logs"
default = true
}
variable "cloudwatch_log_output_enabled" {
type = bool
description = "Enables Systems Manager to send command output to CloudWatch Logs."
default = false
}
variable "cloudwatch_log_group_name" {
type = string
description = "The name of the CloudWatch log group where you want to send command output. If you don't specify a group name, Systems Manager automatically creates a log group for you. The log group uses the following naming format: aws/ssm/SystemsManagerDocumentName."
default = null
}