cloudtools / troposphere

troposphere - Python library to create AWS CloudFormation descriptions
BSD 2-Clause "Simplified" License
4.92k stars 1.45k forks source link

Incorrect ValueError: AllowedPattern can only be used with parameters of the String type #2180

Closed akarve closed 9 months ago

akarve commented 10 months ago

Example:

    cft.add_parameter(
        Parameter(
            "Foo",
            Type="CommaDelimitedList",
            AllowedPattern="^[A-Z]{2}$",
            Default="",
        )
    )

According to the AWS docs this should be allowed:

AllowedPattern A regular expression that represents the patterns to allow for String or CommaDelimitedList types. When applied on a parameter of type String, the pattern must match the entire parameter value provided. When applied to a parameter of type CommaDelimitedList, the pattern must match each value in the list.