Search code examples
aws-cloudformationamazon-ecr

Cloudformation - ECRImageURI failed to satisfy constraint


I have a parameter for an ECRImage URI. When I try to test with a dry run with taskcat, I get the following error

[ERROR ] : ClientError An error occurred (ValidationError) when calling the CreateStack operation: Parameter ECRImageURI failed to satisfy constraint: Allow all characters

But my regular expression for the pattern is already very lenient. Thoughts?

  ECRImageURI:
    AllowedPattern: ".*"
    ConstraintDescription: "Allow all characters"
    Default: 'http://464139160630.dkr.ecr.us-east-2.amazonaws.com/www.pulliam.sh:latest'
    Description: ECR Docker image to use in ECS Task definition.
    MaxLength: '64'
    MinLength: '1'
    Type: String

Edit: Based on the documentation here, Cloudformation uses Java regular expressions. So I can only conclude there is some issue with taskcat, or something else going on.


Solution

  • The regex pattern is satisfied, although ^.*$ would probably be a bit more expressive. But the actual problem seems to be with the MaxLength parameter. For instance, your default value already violates the length limitation.