cfn-lint icon indicating copy to clipboard operation
cfn-lint copied to clipboard

Validation on properties of a parameter

Open aarongorka opened this issue 7 years ago • 2 comments

An invalid property on a parameter doesn't seem to trigger an error (there's a typo in the Default key):

Parameters:
  MyPassword:
    Description: Password
    Type: String
    Defaut: hunter2
    NoEcho: True

This parameter was used in some UserData via Fn::Sub.

aarongorka avatar Oct 25 '17 23:10 aarongorka

Thanks @aarongorka

This is still an issue in v1.3.4.

martysweet avatar Nov 19 '17 18:11 martysweet

Two approaches -

  • hand-write custom validation code for Parameters (also Outputs and Metadata and probably others) (not actually that awful, it would be quite small and probably reusable between all of these sections)
  • write a json schema for these sections, add a runtime dependency on jsonschema, and run jsonschema validation at validation time.

I am actually tending towards the first, but I wouldn't have a huge opinion either way.

akdor1154 avatar Nov 19 '17 21:11 akdor1154