Package the Amazon SAM application - Amazon CodeDeploy
Services or capabilities described in Amazon Web Services documentation might vary by Region. To see the differences applicable to the China Regions, see Getting Started with Amazon Web Services in China (PDF).

Package the Amazon SAM application

You should now have four files in your SAM-Tutorial directory:

  • beforeAllowTraffic.js

  • afterAllowTraffic.js

  • myDateTimeFunction.js

  • template.yml

You are now ready to use the Amazon SAM sam package command to create and package artifacts for your Lambda functions and CodeDeploy application. The artifacts are uploaded to an S3 bucket. The output of the command is a new file called package.yml. This file is used by the Amazon SAM sam deploy command in the next step.

Note

For more information on the sam package command, see Amazon SAM CLI command reference in the Amazon Serverless Application Model Developer Guide.

In the SAM-Tutorial directory, run the following.

sam package \ --template-file template.yml \ --output-template-file package.yml \ --s3-bucket your-S3-bucket

For the s3-bucket parameter, specify the Amazon S3 bucket you created as a prerequisite for this tutorial. The output-template-file specifies the name of the new file that is used by the Amazon SAM sam deploy command.