SAM Doctor

ERROR REFERENCE

An EC2 Image Builder recipe version already exists

Image Builder cannot create a recipe with the same name and semantic version twice. A changed recipe needs a new version, even when the CloudFormation logical resource has not changed.

WHAT IT MEANS

What this error means

Resource handler returned message: "The following resource 'ImageRecipe' already exists: 'recipe/1.1.0' (HandlerErrorCode: AlreadyExists)"

Image Builder recipes are immutable after creation. Reusing a version after changing its parent image, components, or user data makes CloudFormation attempt a duplicate create instead of an in-place edit.

FIX

How to fix it

  1. Inspect the existing recipe (read-only). Use the ARN from the failed event:
    aws imagebuilder get-image-recipe --image-recipe-arn <recipe-arn>
  2. Create a new semantic version. Bump the recipe version when its contents change; do not overwrite the existing version. Image Builder also supports an x wildcard for automatic version increments.
  3. Check dependents before retirement. Confirm which image pipeline or distribution configuration uses the old recipe before removing or replacing it.
  4. Re-run the deployment after checking the synthesized AWS::ImageBuilder::ImageRecipe properties. See the AWS guides for recipe management and recipe versioning.

AUTOMATE THE TRIAGE

Diagnose this automatically

SAM Doctor recognizes the Image Builder collision (high confidence), keeps it separate from generic CloudFormation resource failures, and points at the read-only recipe check. Runs locally; no AWS access, no log upload.

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

RELATED