-
Notifications
You must be signed in to change notification settings - Fork 42
Expand file tree
/
Copy pathmaintenance-window.json
More file actions
162 lines (162 loc) · 4.33 KB
/
maintenance-window.json
File metadata and controls
162 lines (162 loc) · 4.33 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
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
{
"AWSTemplateFormatVersion": "2010-09-09",
"Description": "This template creates a Maintenance Window on the MongoDB Atlas API, this will be billed to your Atlas account.",
"Parameters": {
"Profile": {
"Type": "String",
"Description": "Your MongoDB Atlas Profile Name created in secret manager",
"Default": "default"
},
"MongoDBAtlasProjectId": {
"Type": "String",
"Description": "MongoDB project Id"
},
"DayOfWeek": {
"Type": "Number",
"Description": "Day of the week that the maintenance window starts (1-7, where 1=Sunday)",
"Default": 3,
"MinValue": 1,
"MaxValue": 7
},
"HourOfDay": {
"Type": "Number",
"Description": "Zero-based integer that represents the hour of the day that the maintenance window starts according to a 24-hour clock. Use 0 for midnight and 12 for noon.",
"Default": 2,
"MinValue": 0,
"MaxValue": 23
},
"AutoDeferOnceEnabled": {
"Type": "String",
"AllowedValues": [
"true",
"false"
],
"Default": "false",
"Description": "Flag that indicates whether MongoDB Cloud should defer all maintenance windows for one week after you enable them."
},
"Defer": {
"Type": "String",
"AllowedValues": [
"true",
"false"
],
"Default": "false",
"Description": "Flag that indicates whether to defer the maintenance window. When set to true, the next scheduled maintenance will be deferred."
},
"AutoDefer": {
"Type": "String",
"AllowedValues": [
"true",
"false"
],
"Default": "false",
"Description": "Flag that indicates whether MongoDB Cloud should automatically defer maintenance windows for one week when they occur during the defined maintenance window."
},
"EnableProtectedHours": {
"Type": "String",
"AllowedValues": [
"true",
"false"
],
"Default": "false",
"Description": "Enable protected hours during which MongoDB Cloud cannot start maintenance."
},
"ProtectedHoursStartHour": {
"Type": "Number",
"Description": "Hour of the day when protected hours start (0-23). Only used if EnableProtectedHours is true.",
"Default": 8,
"MinValue": 0,
"MaxValue": 23
},
"ProtectedHoursEndHour": {
"Type": "Number",
"Description": "Hour of the day when protected hours end (0-23). Only used if EnableProtectedHours is true.",
"Default": 18,
"MinValue": 0,
"MaxValue": 23
}
},
"Conditions": {
"UseProtectedHours": {
"Fn::Equals": [
{
"Ref": "EnableProtectedHours"
},
"true"
]
}
},
"Resources": {
"MaintenanceWindow": {
"Type": "MongoDB::Atlas::MaintenanceWindow",
"Properties": {
"Profile": {
"Ref": "Profile"
},
"ProjectId": {
"Ref": "MongoDBAtlasProjectId"
},
"DayOfWeek": {
"Ref": "DayOfWeek"
},
"HourOfDay": {
"Ref": "HourOfDay"
},
"AutoDeferOnceEnabled": {
"Ref": "AutoDeferOnceEnabled"
},
"Defer": {
"Ref": "Defer"
},
"AutoDefer": {
"Ref": "AutoDefer"
},
"ProtectedHours": {
"Fn::If": [
"UseProtectedHours",
{
"StartHourOfDay": {
"Ref": "ProtectedHoursStartHour"
},
"EndHourOfDay": {
"Ref": "ProtectedHoursEndHour"
}
},
{
"Ref": "AWS::NoValue"
}
]
}
}
}
},
"Outputs": {
"NumberOfDeferrals": {
"Description": "Number of times this project has deferred the maintenance window",
"Value": {
"Fn::GetAtt": [
"MaintenanceWindow",
"NumberOfDeferrals"
]
}
},
"TimeZoneId": {
"Description": "Time zone ID for the maintenance window",
"Value": {
"Fn::GetAtt": [
"MaintenanceWindow",
"TimeZoneId"
]
}
},
"StartASAP": {
"Description": "Flag indicating if maintenance starts immediately",
"Value": {
"Fn::GetAtt": [
"MaintenanceWindow",
"StartASAP"
]
}
}
}
}