sincecutoff.com
← all changes

sam package supports --resolve-image-repos

Introduced 2026-01-28 · score 0.95

HOW TO USE IT

When packaging a SAM template with image-based functions, run `sam package` with `--resolve-image-repos` to enable automatic image repository resolution.

sam package --template-file <template.yaml> --s3-bucket <bucket> --resolve-image-repos

WHY THIS HELPS

Package a SAM application that uses image repositories with the repository resolution option.

REQUIREMENTS AND LIMITATIONS

  • Version: v1.153.1
  • --resolve-image-repos: Flag that enables automatic ECR repository resolution; it takes no value.
  • --s3-bucket <bucket> (required): S3 bucket for package artifacts when `--resolve-s3` is not used. The v1.153.1 source raises an error if image repositories are being resolved and no bucket is set.
  • --template-file <template.yaml>: Path to the SAM template; the command otherwise searches the current project directory for a template.
  • Prerequisite: The `sam package` command requires AWS credentials.
  • Prerequisite: Provide `--s3-bucket <bucket>` or use `--resolve-s3` to supply a bucket when resolving image repositories.
  • Docs conflict: The current AWS `sam package` reference page does not list `--resolve-image-repos`; the v1.153.1 official source defines and attaches it to `sam package`. https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/sam-cli-command-reference-sam-package.html

FIRST-PARTY EVIDENCE

Check the installed version and the source before using it. Entry JSON

Report a problem with this card