-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathssm.tf
52 lines (44 loc) · 1.2 KB
/
ssm.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
resource "aws_ssm_maintenance_window" "this" {
cutoff = 1
description = "Patch Manager maintenance window"
duration = 3
name = "patch-manager"
schedule = "cron(0 21 ? * * *)"
schedule_timezone = "Europe/Rome"
}
resource "aws_ssm_maintenance_window_target" "this" {
description = "All instances"
name = "all-instances"
resource_type = "INSTANCE"
targets {
key = "tag:tfe_workspace"
values = ["tf-aws"]
}
window_id = aws_ssm_maintenance_window.this.id
}
resource "aws_ssm_maintenance_window_task" "this" {
description = "Apply patches to all instances"
name = "patch-all"
max_concurrency = 1
max_errors = 1
priority = 1
targets {
key = "WindowTargetIds"
values = [aws_ssm_maintenance_window_target.this.id]
}
task_arn = "AWS-RunPatchBaseline"
task_invocation_parameters {
run_command_parameters {
parameter {
name = "Operation"
values = ["Install"]
}
parameter {
name = "RebootOption"
values = ["RebootIfNeeded"]
}
}
}
task_type = "RUN_COMMAND"
window_id = aws_ssm_maintenance_window.this.id
}