forked from aws-cloudformation/cfn-lint
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathNumberRange.py
24 lines (19 loc) · 862 Bytes
/
NumberRange.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
"""
Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
SPDX-License-Identifier: MIT-0
"""
from cfnlint.rules import CloudFormationLintRule
class NumberRange(CloudFormationLintRule):
"""Check if a Number has a length within the limit"""
id = "W3034"
shortdesc = "Check if parameter values are between min and max"
description = (
"Check if parameter values value being between the minimum" " and maximum"
)
source_url = "https://github.com/aws-cloudformation/cfn-lint/blob/main/docs/cfn-schema-specification.md#number-size"
tags = ["resources", "property", "number", "size"]
def validate(self, validator, m, instance, schema, fn):
for err in fn(validator, m, instance, schema):
err.rule = self
err.path_override = validator.context.path.value_path
yield err