nerdexam
Amazon

DVA-C02 · Question #432

A developer has built an application running on AWS Lambda using AWS Serverless Application Model (AWS SAM). What is the correct sequence of steps to successfully deploy the application?

The correct answer is B. 1. Build the SAM template locally.. The correct AWS SAM deployment sequence is to build the template locally, then package the artifacts to S3, and finally deploy using CloudFormation.

Submitted by minji_kr· Mar 5, 2026Deployment

Question

A developer has built an application running on AWS Lambda using AWS Serverless Application Model (AWS SAM). What is the correct sequence of steps to successfully deploy the application?

Options

  • A
    1. Build the SAM template in Amazon EC2.
  • B
    1. Build the SAM template locally.
  • C
    1. Build the SAM template locally.
  • D
    1. Build the SAM template locally.

How the community answered

(52 responses)
  • A
    2% (1)
  • B
    88% (46)
  • C
    4% (2)
  • D
    6% (3)

Why each option

The correct AWS SAM deployment sequence is to build the template locally, then package the artifacts to S3, and finally deploy using CloudFormation.

A1. Build the SAM template in Amazon EC2.

Building the SAM template on Amazon EC2 is unnecessary and adds infrastructure overhead; the SAM CLI is designed to run locally and does not require an EC2 instance for the build step.

B1. Build the SAM template locally.Correct

The SAM CLI workflow starts with sam build locally to compile code and resolve dependencies, followed by sam package (or sam deploy --guided) to upload artifacts to S3 and produce a transformed CloudFormation template, and then sam deploy to create or update the CloudFormation stack. Building locally ensures dependencies are resolved in the correct runtime environment before packaging.

C1. Build the SAM template locally.

This option likely reverses or omits a required step in the sequence (such as packaging before deploying), which would cause the deployment to fail because artifacts have not been uploaded to S3.

D1. Build the SAM template locally.

This option likely specifies an incorrect or incomplete sequence, such as skipping the package step or deploying before building, which would result in a failed or incomplete deployment.

Concept tested: AWS SAM CLI deployment sequence: build, package, deploy

Source: https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/sam-cli-command-reference-sam-deploy.html

Community Discussion

No community discussion yet for this question.

Full DVA-C02 Practice