SAM Doctor

ERROR REFERENCE

CloudFormation could not find the imported stack export

The consumer stack uses Fn::ImportValue, but no export with that exact name is available in the account and Region where the deployment is running. This is a cross-stack dependency problem, not an IAM denial or a rollback root cause.

WHAT IT MEANS

The export name is missing at resolution time

An error occurred (ValidationError) when calling the CreateChangeSet operation: No export named shared-vpc-id found

CloudFormation resolves an imported output from a producer stack in the same account and Region. The producer may not have run yet, its Outputs / Export: Name may have changed, or the consumer is using the wrong account, Region, profile, or pipeline environment.

NEXT CHECK

Compare the name, producer, account, and Region

  1. Preserve the exact name. Copy the export name from the error and compare it with the consumer's Fn::ImportValue after SAM or another transform has produced the submitted template.
  2. List exports in the failing context. Run
    aws cloudformation list-exports --region <region>
    with the same profile or role used by the deployment. If the name is absent, CloudFormation is reporting the dependency accurately.
  3. Check the producer stack. Confirm its Outputs section still defines the exact Export: Name, deploy that stack first, and wait for it to finish before the consumer runs. Keep an export name stable once other stacks depend on it.
  4. Check the boundary. CloudFormation exports and Fn::ImportValue resolve only within the same account and Region. For an intentional cross-account or cross-Region handoff, use an explicit parameter or a supported output-sharing mechanism instead of a local export.

AUTOMATE THE TRIAGE

Diagnose this automatically

SAM Doctor recognizes the missing-export marker (high confidence) and points at the producer stack and deployment boundary instead of sending you to IAM or leaving you with rollback noise. Runs locally; no AWS access, no log upload.

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

RELATED