Cloudformation failed to satisfy constraint: Member must have length less than or equal to 51200

Viewed 3151

Validating CloudFormation template using awscli

aws cloudformation validate-template --template-body file://C:/path/file.yaml

returns

failed to satisfy constraint: Member must have length less than or equal to 51200

Is there a possible easy fix?

1 Answers

validate-template --template-body has a constraint of maximum length of 51,200 bytes (50KB). To validate a local file, filesize must be less than 50KB.

If you want to validate templates larger in size you can upload it to s3 and then use the --template-url argument. It has a constraint of 460800 bytes (450KB)

aws s3 cp $PATH_TO_FILE s3://$BUCKET_NAME/PATH
aws cloudformation validate-template --template-url https://$BUCKET_NAME.s3.amazonaws.com/path/file.yml
Related