@@ -28,8 +28,11 @@ type Option struct {
28
28
}
29
29
30
30
type Validation struct {
31
- Min * int
32
- Max * int
31
+ Min * int
32
+ MinOk bool `mapstructure:"min_ok"`
33
+ Max * int
34
+ MaxOk bool `mapstructure:"max_ok"`
35
+
33
36
Monotonic string
34
37
35
38
Regex string
@@ -288,11 +291,21 @@ func parameterDataSource() *schema.Resource {
288
291
Optional :true ,
289
292
Description :"The minimum of a number parameter." ,
290
293
},
294
+ "min_ok" : {
295
+ Type :schema .TypeBool ,
296
+ Computed :true ,
297
+ Description :"Helper field to check if min is present" ,
298
+ },
291
299
"max" : {
292
300
Type :schema .TypeInt ,
293
301
Optional :true ,
294
302
Description :"The maximum of a number parameter." ,
295
303
},
304
+ "max_ok" : {
305
+ Type :schema .TypeBool ,
306
+ Computed :true ,
307
+ Description :"Helper field to check if max is present" ,
308
+ },
296
309
"monotonic" : {
297
310
Type :schema .TypeString ,
298
311
Optional :true ,
@@ -366,9 +379,15 @@ func fixValidationResourceData(rawConfig cty.Value, validation interface{}) (int
366
379
// Fix the resource data
367
380
if rawValidationRule ["min" ].IsNull () {
368
381
validationRule ["min" ]= nil
382
+ validationRule ["min_ok" ]= false
383
+ }else {
384
+ validationRule ["min_ok" ]= true
369
385
}
370
386
if rawValidationRule ["max" ].IsNull () {
371
387
validationRule ["max" ]= nil
388
+ validationRule ["max_ok" ]= false
389
+ }else {
390
+ validationRule ["max_ok" ]= true
372
391
}
373
392
return vArr ,nil
374
393
}