Sceptre / sceptre

Build better AWS infrastructure
https://docs.sceptre-project.org
Other
1.49k stars 313 forks source link

[Resolve #1443] Add parameter type checking #1442

Closed alex-harvey-z3q closed 9 months ago

alex-harvey-z3q commented 9 months ago

For historical reasons, Sceptre has never validated Stack config parameters that are passed in to CloudFormation stack parameters. Blocks that contain bools, ints etc give rise to confusing failures. For example:

parameters:
  someBool: true

Would lead to an error appearing like:

"Parameter validation failed:\nInvalid type for parameter Parameters[0].ParameterValue, value: 1, type: <class 'bool'>, valid types: <class 'str'>"  

In more complicated examples it is often quite unclear what Parameter[0] means.

A feature here is added at the time of Stack instantiation to perform validation of the input stack parameters in a similar manner to how the ignore and obsolete settings were already being checked.

PR Checklist

Approver/Reviewer Checklist

Other Information

Guide to writing a good commit