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 publish

Publish an AWS SAM application to the AWS Serverless Application Repository. This command takes a packaged AWS SAM template and publishes the application to the specified region.

This command expects the AWS SAM template to include a Metadata containing application metadata required for publishing. Furthermore, these properties must include references to Amazon S3 buckets for LicenseUrl and ReadmeUrl values, and not references to local files. For more details about the Metadata section of the AWS SAM template, see Publishing Serverless Applications Using the AWS SAM CLI.

This command creates the application as private by default, so you must share the application before other AWS accounts are allowed to view and deploy the application. For more information on sharing applications see Using Resource-Based Policies for the AWS Serverless Application Repository.

Usage:

sam publish [OPTIONS]

Examples:

To publish an application $ sam publish --template packaged.yaml --region us-east-1

Options:

Option Description
-t, --template PATH AWS SAM template file [default: template.[yaml|yml]].
--semantic-version TEXT Optional. The semantic version of the application provided by this parameter overrides SemanticVersion in the Metadata section of the template file. https://semver.org/
--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.