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
-
List the missing IDs from the error. Compare each
name with the exact logical IDs under
ResourcesandParametersin the submitted or SAM-transformed template. -
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. -
Validate the exact artifact the deploy submits:
For SAM, validate the transformed or built template when that is the file passed to the deploy command.sam validate --lint --template <template> cfn-lint <template>
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
Related errors
- Malformed Fn::GetAtt parameters - the intrinsic function has the wrong number of arguments.
- Property not defined for a resource type - a property exists, but not on the named resource schema.
- Failed to create changeset - the wrapper around a more specific template or service error.