HOT parameter validation
This blueprint is to address full parameter validation based on the current HOT hello world implementation. HOT will use an enhanced syntax for defining parameters constraints - partly taken from proposal discussed at [1] - which will be implemented by this blueprint.
Goal is to have feature equivalance with cfn parameter validation, plus addtional enhanced features (e.g. multiple regular expressions, specific validation message per constraint, etc.).
As part of this blueprint we also plan to provide an enhanced HOT sample template, as well as documentation of the parameter validation syntax.
Blueprint information
- Status:
- Complete
- Approver:
- Steve Baker
- Priority:
- High
- Drafter:
- Thomas Spatzier
- Direction:
- Approved
- Assignee:
- JunJie Nan
- Definition:
- Approved
- Series goal:
- Accepted for havana
- Implementation:
- Implemented
- Milestone target:
- 2013.2
- Started by
- JunJie Nan
- Completed by
- JunJie Nan
Related branches
Related bugs
Bug #1199311: Default attribute is missed in hot translate parameter | Fix Released |
Bug #1204061: heat template-validate does not work on hot template | Fix Released |
Sprints
Whiteboard
Here is a sample to show the parameter constraints syntax for HOT, inspired by [1]. The processing of this syntax will be enabled by the blueprint.
heat_template_
parameters:
SampleStringP
type: string
description: sample parameter to show parameter constraints for strings
default: sample
hidden: true
constraints:
- allowed_values: [sample, othersample, and_one_more]
Value must be one of sample, othersample or and_one_more
- allowed_pattern: "[a-zA-Z]+"
- allowed_pattern: "[a-z]+[a-zA-Z]*"
- length: { min: 4, max: 10}
SampleNumberP
type: number
description: sample parameter to show parameter constraints for numbers
default: 1
constraints:
- allowed_values: [1, 2, 4, 8]
- range: { min: 1, max: 8}
Explanation of some elements:
hidden: true | false -> covers cfn NoEcho setting; default (if omitted) is false
constraints is an array of the single constraints. There can be multiple constraints of a type. For example, there can be multiple 'allowed_pattern' constraints to allow users to split complicated regexes into smaller pieces.
There should be one constraint description for each single constraint, which allows for giving the user precise feedback.
Contraint types and mapping to cfn constraints:
allowed_values -> cfn AllowedValues
allowed_pattern -> cfn AllowedPattern
lengh (with min and max settings) -> cfn MinLength and MaxLength
min and max are option, but one must be given
range (with min and max settings) -> cfn MinValue and MaxValue for numbers
min and max are option, but one must be given
(thomas-spatzier) 20130722:
Removed 'constraints_
Gerrit topic: https:/
Addressed by: https:/
HOT parameter validation model translation
Addressed by: https:/
Hot parameter validator
Addressed by: https:/
Fix test cases using dict as template or schema directly
Addressed by: https:/
Rename: VALUES to ALLOWED_VALUES, PATTERN to ALLOWED_PATTERN
Addressed by: https:/
Fix test cases pass dict as template object directly.
Addressed by: https:/
Do validation in schema object
Work Items
Work items:
Model translation: DONE
Hot Parameter Validation: INPROGRESS
Dependency tree
* Blueprints in grey have been implemented.