Expand description
Regexes for well-known AWS resource value formats (identifiers, record values, names) shared by the schema validator and the rule engines.
Constants§
- AMI_
ID_ PATTERN - Regex for an EC2 AMI identifier:
ami-followed by an 8- or 17-character hex id. The two fixed lengths (not a{8,17}range) reflect the only id widths EC2 issues, so a 9–16 character string is not mistaken for an AMI id. - AVAILABILITY_
ZONE_ PATTERN - Regex recognizing a hardcoded EC2 Availability Zone name (e.g.
us-east-1a,us-gov-west-1a,us-iso-east-1a). The repeated(-[a-z]+)+segment matches partition-qualified zones (GovCloud/ISO) a single-segment pattern would miss. - CAA_
RECORD_ PATTERN - Regex for a Route53
CAArecord value: a flag0or128, a tag, and a quoted value, each separated by a single whitespace. The single\s(not\s+) matches the service’s own single-separator requirement. - IAM_
ROLE_ ARN_ PATTERN - Regex for the
AWS::IAM::Role.Arnschema format check: the partition must beaws-prefixed and the role name is unrestricted (.+), so a role name containing a space or other legal-but-unusual character is accepted here. - IAM_
ROLE_ NAME_ PATTERN - Regex for an IAM role name with an optional path. Paths use printable ASCII and the role name uses the IAM role-name character set with its 64-character limit.
- MX_
RECORD_ PATTERN - Regex for a Route53
MXrecord value: a preference0–65535, a single whitespace, then the mail-exchange host. The bounded-preference alternation enforces the 16-bit range (an unbounded\d+would wrongly accept70000), and the single\srejects the double-space form the service rejects. - SECURITY_
GROUP_ NAME_ PATTERN - Regex for a valid EC2 Security Group name. The class mirrors the character set the service
accepts; the
+requires at least one character.