The format
keyword in JSON Schema is used to define a regular expression pattern that a string value should match. It provides a way to validate that a string adheres to a specific format or pattern.
In cfn-lint
, we have extended the format
keyword to support custom formats that are specific to AWS resources. These custom formats help validate values against specific patterns or constraints defined by AWS.
cfn-lint
supports the following custom formats:
This format ensures that the value is a valid VPC ID, which is a string of the pattern vpc-[0-9a-f]{8}
or vpc-[0-9a-f]{17}
.
This format validates that the value is a valid security group ID, which is a string of the pattern sg-[0-9a-f]{8}
or sg-[0-9a-f]{17}
.
This format validates that the value is a valid list of security group IDs, which is a string of the pattern sg-[0-9a-f]{8}
or sg-[0-9a-f]{17}
.
This format validates that the value is a valid security group name, which must be a string of 1 to 255 characters, starting with a letter, and containing only letters, numbers, and certain special characters.
This format validates that the value is a valid list of security group names, which must be a string of 1 to 255 characters, starting with a letter, and containing only letters, numbers, and certain special characters.
This format validates that the value is a valid Amazon Machine Image (AMI), which is a string of the pattern ami-[0-9a-f]{8}
or ami-[0-9a-f]{17}
. More info in docs
This format validates that the value is a valid IAM Role ARN, which is a string of the pattern ^arn:(aws|aws-cn|aws-iso|aws-iso-[a-z]{1}|aws-us-gov):iam::\d{12}:role/.*$
. More info in docs
This format validates that the value is a valid log group name, which is a string of the pattern ^[\.\-_\/#A-Za-z0-9]{1,512}\Z
. More info in docs
Validates the value against the python implementation of validating an IPV4 network
Validates the value against the python implementation of validating an IPV6 network