AWS Serverless Application Model
Developer Guide

The AWS Documentation website is getting a new look!
Try it now and let us know what you think. Switch to the new look >>

You can return to the original look by selecting English in the language selector above.

sam package

Packages an AWS SAM application. This is an alias for aws cloudformation package.


If the AWS SAM template contains a Metadata section for ServerlessRepo, and the LicenseUrl or ReadmeUrl properties contain references to local files, you must update AWS CLI to version 1.16.77 or later. For more information about the Metadata section of AWS SAM templates and publishing applications with AWS SAM CLI, see Publishing Serverless Applications Using the AWS SAM CLI.


sam package [OPTIONS] [ARGS]...


Option Description
--template-file PATH The path where your AWS SAM template is located.
--s3-bucket BUCKET The name of the S3 bucket where this command uploads the artifacts that are referenced in your template.
--output-template-file PATH The path to the file where the command writes the packaged template. If you don't specify a path, the command writes the template to the standard output.
--profile TEXT Select a specific profile from your credential file to get AWS credentials.
--region TEXT Sets the AWS Region of the service (for example, us-east-1).
--debug Turns on debug logging.
--help Shows this message and exits.