Warnings for ignored/malformed objects in serverless.yml

A couple of times, I’ve gotten snagged by a misspelling or incorrect capitalization of an identifier in a serverless.yml file.

Example: If you put this vpc configuration in your provider block, it will get ignored:

- sg-xxxxx
- subnet-xxxx

Why? Because “SecurityGroupIds” and “SubnetIds” should not have an initial upper-case letter. It’s “securityGroupIds”, etc.

Which is OK, dumb mistake.

But couldn’t serverless issue a warning when the expected fields of ‘vpc’ are not found? or when an object like this ends up being ignored because it’s malformed? Would save a lot of time.

Serverless already use AWS validateTemplate API to validate CF (see: https://github.com/serverless/serverless/issues/4511). Failing that, it’d be an issue that AWS APIs should be fixing.

Which would work if the typo I mentioned was in the resources block, presumably. But when serverless builds the compiled cf template, it simply skips anything it doesn’t understand, which is why no error is emitted.