cloudformation-resource-schema icon indicating copy to clipboard operation
cloudformation-resource-schema copied to clipboard

Add runtime schema validation for things that can't be checked by JSONSchema

Open aygold92 opened this issue 5 years ago • 3 comments

  • [x] a property can't be readOnly and writeOnly.
  • [x] a property can't be readOnly and createOnly.
  • [x] an identifier must be either createOnly or readOnly (note: this one is debatable, but CFN does not currently support updating the physicalResourceId)
  • [ ] ensure that jsonPointers map to actual properties

Update (3/16/2020)

Please add more as we come across them

aygold92 avatar Jun 06 '19 21:06 aygold92

Please see RPDK resource_generator.py (permalink) for additional semantic validations that should be implemented:

  • strings: using format and pattern together may be nonsensical
  • integer/number: using minimum and exclusiveMinimum together may be nonsensical, same with maximum
  • integer/number: validate that minimum < maximum (minimum == maximum makes no sense either, and should use const instead), same for exclusive ones. added complication: perform this validation with minimum and exclusiveMaximum and vice versa.

tobywf avatar Aug 19 '19 20:08 tobywf

While primaryIdentifier can be an array (of pointers), a pointer within that array should not point to an array (at least, that's not currently supported). This is not checked during registration but fails (opaquely) at runtime.

benkehoe avatar Mar 17 '20 12:03 benkehoe

added some of these to cfn validate: https://github.com/aws-cloudformation/cloudformation-cli/pull/663, https://github.com/aws-cloudformation/cloudformation-cli/pull/668, https://github.com/aws-cloudformation/cloudformation-cli/pull/675, https://github.com/aws-cloudformation/cloudformation-cli/pull/729

PatMyron avatar Jun 10 '21 02:06 PatMyron