Which step should the developer complete prior to deploying the application?
Compress the application to a .zip file and upload it into AWS Lambda.
Test the new AWS Lambda function by first tracing it in AWS X-Ray.
Bundle the serverless application using a SAM package.
Create the application environment using the eb create my-env command.
Explanations:
Compressing the application to a .zip file and uploading it manually is not necessary when using AWS SAM, as SAM CLI manages the packaging and deployment process automatically.
Testing the AWS Lambda function using AWS X-Ray is useful for debugging and tracing, but it is not a prerequisite step prior to deploying the application. It is more of a post-deployment action.
Bundling the serverless application using a SAM package is the necessary step before deployment. The SAM package command prepares the application code and dependencies, uploads them to an S3 bucket, and generates a deployment-ready AWS CloudFormation template.
The commandeb create my-envis associated with AWS Elastic Beanstalk, not AWS Lambda or the SAM CLI. Therefore, this option is not relevant to deploying a serverless application using AWS SAM.