File tree 4 files changed +267
-54
lines changed
src/cfnlint/data/schemas/extensions/aws_ecs_taskdefinition
test/unit/rules/resources/ecs
4 files changed +267
-54
lines changed Original file line number Diff line number Diff line change 34
34
{
35
35
"properties" : {
36
36
"Cpu" : {
37
- "enum" : [
38
- " 256"
39
- ]
37
+ "else" : {
38
+ "pattern" : " ^\\ .25\\ s*(?i)vCpu$"
39
+ },
40
+ "if" : {
41
+ "pattern" : " ^\\ d+$" ,
42
+ "type" : [
43
+ " integer" ,
44
+ " string"
45
+ ]
46
+ },
47
+ "then" : {
48
+ "enum" : [
49
+ " 256"
50
+ ]
51
+ }
40
52
},
41
53
"Memory" : {
42
54
"enum" : [
55
+ " 0.5 GB" ,
56
+ " 1 GB" ,
57
+ " 2 GB" ,
43
58
" 512" ,
44
59
" 1024" ,
45
60
" 2048"
50
65
{
51
66
"properties" : {
52
67
"Cpu" : {
53
- "enum" : [
54
- " 512"
55
- ]
68
+ "else" : {
69
+ "pattern" : " ^\\ .5\\ s*(?i)vCpu$"
70
+ },
71
+ "if" : {
72
+ "pattern" : " ^\\ d+$" ,
73
+ "type" : [
74
+ " integer" ,
75
+ " string"
76
+ ]
77
+ },
78
+ "then" : {
79
+ "enum" : [
80
+ " 512"
81
+ ]
82
+ }
56
83
},
57
84
"Memory" : {
58
- "maximum" : 4096 ,
59
- "minimum" : 1024 ,
60
- "multipleOf" : 1024
85
+ "else" : {
86
+ "pattern" : " ^(1|2|3|4)\\ s*(?i)GB$"
87
+ },
88
+ "if" : {
89
+ "pattern" : " ^\\ d+$" ,
90
+ "type" : [
91
+ " integer" ,
92
+ " string"
93
+ ]
94
+ },
95
+ "then" : {
96
+ "maximum" : 4096 ,
97
+ "minimum" : 1024 ,
98
+ "multipleOf" : 1024
99
+ }
61
100
}
62
101
}
63
102
},
64
103
{
65
104
"properties" : {
66
105
"Cpu" : {
67
- "enum" : [
68
- " 1024"
69
- ]
106
+ "else" : {
107
+ "pattern" : " ^1\\ s*(?i)vCpu$"
108
+ },
109
+ "if" : {
110
+ "pattern" : " ^\\ d+$" ,
111
+ "type" : [
112
+ " integer" ,
113
+ " string"
114
+ ]
115
+ },
116
+ "then" : {
117
+ "enum" : [
118
+ " 1024"
119
+ ]
120
+ }
70
121
},
71
122
"Memory" : {
72
- "maximum" : 8192 ,
73
- "minimum" : 2048 ,
74
- "multipleOf" : 1024
123
+ "else" : {
124
+ "pattern" : " ^(2|3|4|5|6|7|8)\\ s*(?i)GB$"
125
+ },
126
+ "if" : {
127
+ "pattern" : " ^\\ d+$" ,
128
+ "type" : [
129
+ " integer" ,
130
+ " string"
131
+ ]
132
+ },
133
+ "then" : {
134
+ "maximum" : 8192 ,
135
+ "minimum" : 2048 ,
136
+ "multipleOf" : 1024
137
+ }
75
138
}
76
139
}
77
140
},
78
141
{
79
142
"properties" : {
80
143
"Cpu" : {
81
- "enum" : [
82
- " 2048"
83
- ]
144
+ "else" : {
145
+ "pattern" : " ^2\\ s*(?i)vCpu$"
146
+ },
147
+ "if" : {
148
+ "pattern" : " ^\\ d+$" ,
149
+ "type" : [
150
+ " integer" ,
151
+ " string"
152
+ ]
153
+ },
154
+ "then" : {
155
+ "enum" : [
156
+ " 2048"
157
+ ]
158
+ }
84
159
},
85
160
"Memory" : {
86
- "maximum" : 16384 ,
87
- "minimum" : 4096 ,
88
- "multipleOf" : 1024
161
+ "else" : {
162
+ "pattern" : " ^(4|5|6|7|8|9|10|11|12|13|14|15|16)\\ s*(?i)GB$"
163
+ },
164
+ "if" : {
165
+ "pattern" : " ^\\ d+$" ,
166
+ "type" : [
167
+ " integer" ,
168
+ " string"
169
+ ]
170
+ },
171
+ "then" : {
172
+ "maximum" : 16384 ,
173
+ "minimum" : 4096 ,
174
+ "multipleOf" : 1024
175
+ }
89
176
}
90
177
}
91
178
},
92
179
{
93
180
"properties" : {
94
181
"Cpu" : {
95
- "enum" : [
96
- " 4096"
97
- ]
182
+ "else" : {
183
+ "pattern" : " ^4\\ s*(?i)vCpu$"
184
+ },
185
+ "if" : {
186
+ "pattern" : " ^\\ d+$" ,
187
+ "type" : [
188
+ " integer" ,
189
+ " string"
190
+ ]
191
+ },
192
+ "then" : {
193
+ "enum" : [
194
+ " 4096"
195
+ ]
196
+ }
98
197
},
99
198
"Memory" : {
100
- "maximum" : 30720 ,
101
- "minimum" : 8192 ,
102
- "multipleOf" : 1024
199
+ "else" : {
200
+ "pattern" : " ^(8|9|1[0-9]|2[0-9]|30)\\ s*(?i)GB$"
201
+ },
202
+ "if" : {
203
+ "pattern" : " ^\\ d+$" ,
204
+ "type" : [
205
+ " integer" ,
206
+ " string"
207
+ ]
208
+ },
209
+ "then" : {
210
+ "maximum" : 30720 ,
211
+ "minimum" : 8192 ,
212
+ "multipleOf" : 1024
213
+ }
103
214
}
104
215
}
105
216
},
106
217
{
107
218
"properties" : {
108
219
"Cpu" : {
109
- "enum" : [
110
- " 8192"
111
- ]
220
+ "else" : {
221
+ "pattern" : " ^8\\ s*(?i)vCpu$"
222
+ },
223
+ "if" : {
224
+ "pattern" : " ^\\ d+$" ,
225
+ "type" : [
226
+ " integer" ,
227
+ " string"
228
+ ]
229
+ },
230
+ "then" : {
231
+ "enum" : [
232
+ " 8192"
233
+ ]
234
+ }
112
235
},
113
236
"Memory" : {
114
- "maximum" : 61440 ,
115
- "minimum" : 16384 ,
116
- "multipleOf" : 4096
237
+ "else" : {
238
+ "pattern" : " ^(16|20|24|28|32|36|40|44|48|52|56|60)\\ s*(?i)GB$"
239
+ },
240
+ "if" : {
241
+ "pattern" : " ^\\ d+$" ,
242
+ "type" : [
243
+ " integer" ,
244
+ " string"
245
+ ]
246
+ },
247
+ "then" : {
248
+ "maximum" : 61440 ,
249
+ "minimum" : 16384 ,
250
+ "multipleOf" : 4096
251
+ }
117
252
}
118
253
}
119
254
},
120
255
{
121
256
"properties" : {
122
257
"Cpu" : {
123
- "enum" : [
124
- " 16384"
125
- ]
258
+ "else" : {
259
+ "pattern" : " ^16\\ s*(?i)vCpu$"
260
+ },
261
+ "if" : {
262
+ "pattern" : " ^\\ d+$" ,
263
+ "type" : [
264
+ " integer" ,
265
+ " string"
266
+ ]
267
+ },
268
+ "then" : {
269
+ "enum" : [
270
+ " 16384"
271
+ ]
272
+ }
126
273
},
127
274
"Memory" : {
128
- "maximum" : 122880 ,
129
- "minimum" : 32768 ,
130
- "multipleOf" : 8192
275
+ "else" : {
276
+ "pattern" : " ^(32|40|48|56|64|72|80|88|96|104|112|120)\\ s*(?i)GB$"
277
+ },
278
+ "if" : {
279
+ "pattern" : " ^\\ d+$" ,
280
+ "type" : [
281
+ " integer" ,
282
+ " string"
283
+ ]
284
+ },
285
+ "then" : {
286
+ "maximum" : 122880 ,
287
+ "minimum" : 32768 ,
288
+ "multipleOf" : 8192
289
+ }
131
290
}
132
291
}
133
292
}
Original file line number Diff line number Diff line change 41
41
"then" : {
42
42
"properties" : {
43
43
"Cpu" : {
44
- "enum" : [
45
- " 256" ,
46
- " 512" ,
47
- " 1024" ,
48
- " 2048" ,
49
- " 4096" ,
50
- " 8192" ,
51
- " 16384"
52
- ]
44
+ "else" : {
45
+ "pattern" : " ^(\\ .25|\\ .5|1|2|4|8|16)\\ s*(?i)vCpu$"
46
+ },
47
+ "if" : {
48
+ "pattern" : " ^\\ d+$" ,
49
+ "type" : [
50
+ " integer" ,
51
+ " string"
52
+ ]
53
+ },
54
+ "then" : {
55
+ "enum" : [
56
+ " 256" ,
57
+ " 512" ,
58
+ " 1024" ,
59
+ " 2048" ,
60
+ " 4096" ,
61
+ " 8192" ,
62
+ " 16384"
63
+ ]
64
+ }
53
65
}
54
66
}
55
67
}
You can’t perform that action at this time.
0 commit comments