A serverless application built with AWS Lambda will be deployed using the AWS SAM CLI. Which step should you perform before deploying the application with SAM?
Choose an answer
Tap an option to check your answer.
Correct answer: Package the serverless application using the SAM packaging command (sam package)..
Why this is the answer
Before deploying a serverless application with the AWS SAM CLI, you must first package it using the sam package command. This command uploads your application's artifacts (like Lambda function code and layers) to an S3 bucket, and then creates a new SAM template with references to these S3 locations. The sam deploy command then uses this packaged template to create or update your CloudFormation stack. Zipping and uploading directly to Lambda bypasses SAM's deployment process and CloudFormation management. Testing with X-Ray is a post-development/pre-deployment step for observability, not a prerequisite for SAM deployment. eb create my-env is an Elastic Beanstalk command and is irrelevant for serverless applications deployed with SAM.
Pass your exam — without the endless answer hunt
Get every verified question and explanation for this exam in one place, and save hours of prep. 1,000+ certifications · 20+ languages · free to start.
Pass your exam faster → No card needed