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-reposWHY 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
- https://github.com/aws/aws-sam-cli/releases/tag/v1.153.1
- https://github.com/aws/aws-sam-cli/blob/v1.153.1/samcli/commands/package/command.py
- https://github.com/aws/aws-sam-cli/blob/v1.153.1/samcli/commands/_utils/options.py
- https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/sam-cli-command-reference-sam-package.html
Check the installed version and the source before using it. Entry JSON