-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathpatch_groups.tf
68 lines (64 loc) · 2.36 KB
/
patch_groups.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
########## SCAN ##########
resource "aws_ssm_patch_group" "patchgroup-scan-default" {
count = var.default_scan ? 9 : 0
baseline_id = element([
data.aws_ssm_patch_baseline.windows.id,
data.aws_ssm_patch_baseline.suse.id,
data.aws_ssm_patch_baseline.ubuntu.id,
data.aws_ssm_patch_baseline.debian.id,
data.aws_ssm_patch_baseline.rhel.id,
data.aws_ssm_patch_baseline.amazon.id,
data.aws_ssm_patch_baseline.amazon2.id,
data.aws_ssm_patch_baseline.centos.id,
data.aws_ssm_patch_baseline.oracle.id
], count.index)
patch_group = "SCAN"
}
########## AZ-A ##############
resource "aws_ssm_patch_group" "patchgroup-install-default-a" {
count = var.default_patch_groups ? 9 : 0
baseline_id = element([
data.aws_ssm_patch_baseline.windows.id,
data.aws_ssm_patch_baseline.suse.id,
data.aws_ssm_patch_baseline.ubuntu.id,
data.aws_ssm_patch_baseline.debian.id,
data.aws_ssm_patch_baseline.rhel.id,
data.aws_ssm_patch_baseline.amazon.id,
data.aws_ssm_patch_baseline.amazon2.id,
data.aws_ssm_patch_baseline.centos.id,
data.aws_ssm_patch_baseline.oracle.id
], count.index)
patch_group = var.maintenance_windows[0]
}
############## AZ-B ##############
resource "aws_ssm_patch_group" "patchgroup-install-default-b" {
count = var.default_patch_groups ? 9 : 0
baseline_id = element([
data.aws_ssm_patch_baseline.windows.id,
data.aws_ssm_patch_baseline.suse.id,
data.aws_ssm_patch_baseline.ubuntu.id,
data.aws_ssm_patch_baseline.debian.id,
data.aws_ssm_patch_baseline.rhel.id,
data.aws_ssm_patch_baseline.amazon.id,
data.aws_ssm_patch_baseline.amazon2.id,
data.aws_ssm_patch_baseline.centos.id,
data.aws_ssm_patch_baseline.oracle.id
], count.index)
patch_group = var.maintenance_windows[1]
}
############## AZ-C ##############
resource "aws_ssm_patch_group" "patchgroup-install-default-c" {
count = var.default_patch_groups ? 9 : 0
baseline_id = element([
data.aws_ssm_patch_baseline.windows.id,
data.aws_ssm_patch_baseline.suse.id,
data.aws_ssm_patch_baseline.ubuntu.id,
data.aws_ssm_patch_baseline.debian.id,
data.aws_ssm_patch_baseline.rhel.id,
data.aws_ssm_patch_baseline.amazon.id,
data.aws_ssm_patch_baseline.amazon2.id,
data.aws_ssm_patch_baseline.centos.id,
data.aws_ssm_patch_baseline.oracle.id
], count.index)
patch_group = var.maintenance_windows[2]
}