Cloudformation 未能满足约束:成员的长度必须小于或等于 51200

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

正在使用 awscli 验证 CloudFormation 模板

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

是否有可能的简单修复方法?

validate-template --template-body 的最大长度限制为 51,200 字节 (50KB)。要验证本地文件,文件大小必须小于 50KB。

如果您想验证更大的模板,您可以将其上传到 s3,然后使用 --template-url 参数。它的限制为 460800 字节 (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