SAM Doctor

ERROR REFERENCE

The template references an unresolved resource dependency

CloudFormation could not resolve one or more logical IDs in the template. Fix the reference or define the missing resource or parameter before changing credentials or waiting for the stack.

WHAT IT MEANS

What this error means

Template format error: Unresolved resource dependencies [Environment] in the Resources block of the template

The names inside brackets are logical IDs CloudFormation could not resolve. A misspelled or case-mismatched Ref, Fn::GetAtt, DependsOn, or substitution can fail the change set before any resource is created.

NEXT CHECK

Make every reference resolve

  1. List the missing IDs from the error. Compare each name with the exact logical IDs under Resources and Parameters in the submitted or SAM-transformed template.
  2. Check every reference and its case. Search for Ref, Fn::GetAtt, DependsOn, and substitutions that use the bracketed names. A logical ID must exist in the same template scope.
  3. Validate the exact artifact the deploy submits:
    sam validate --lint --template <template>
    cfn-lint <template>
    For SAM, validate the transformed or built template when that is the file passed to the deploy command.

AUTOMATE THE TRIAGE

Keep the check in your normal workflow

SAM Doctor recognizes this high-confidence template error and points at the unresolved logical ID before you retry the change set. Runs locally; no AWS access, no log upload.

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

RELATED