validate-template asks CloudFormation 24 whether a template parses as JSON or YAML, and lists its parameters. It does not check property values against the resource schemas, so it passes templates that will fail at deploy time. cfn-lint 2,641 (cfn-lint Setup) checks them:
sed 's/PAY_PER_REQUEST/ON_DEMAND/' catalog.yaml > broken.yaml
aws cloudformation validate-template --template-body file://broken.yaml; echo "exit $?"
cfn-lint broken.yaml; echo "exit $?"; rm broken.yamlOutput
{
"Parameters": []
}
exit 0
E3639 'ProvisionedThroughput' is a required property
broken.yaml:5:5
E3030 'ON_DEMAND' is not one of ['PAY_PER_REQUEST', 'PROVISIONED']
broken.yaml:7:7
exit 2The console calls this mode on-demand, but the API value is PAY_PER_REQUEST, and only cfn-lint knew. A template that is not valid YAML fails both tools. Run cfn-lint first; validate-template adds only what the service itself checks, such as the 51,200-byte limit on an inline template.