SAM Doctor

ERROR REFERENCE

property not defined for resource of type AWS::Serverless::*

One named property on one named resource is not valid for that resource type. The error already did the debugging — it names the property and the type; the fix is deciding which of the two is wrong.

WHAT IT MEANS

What this error means

property StageName: not defined for resource of type AWS::Serverless::Api-style errors have three usual causes: the property belongs to a different resource type (an HttpApi property on an Api, a function property on a state machine); the property is misspelled or wrongly cased; or the property is real but newer than the transform being applied.

FIX

How to fix it

  1. Open the reference page for the exact type in the error and search for the property. If it exists on a sibling type, you have your answer — move it or change the resource type.
  2. Check spelling and case exactly. SAM properties are PascalCase and unforgiving; stageName is not StageName.
  3. Validate locally before the next deploy:
    sam validate --lint

AUTOMATE THE TRIAGE

Diagnose this automatically

SAM Doctor recognizes the single-property mismatch (high confidence) and hands broader document failures to the schema-validation rule. Runs locally; no AWS access, no log upload.

python -m pip install sam-doctor
sam-doctor diagnose deployment.log --format markdown

RELATED