nerdexam
Amazon

DVA-C02 · Question #744

Given the source code for an AWS Lambda function in the local file store.py containing a handler function called get_store and the following AWS CloudFormation template: What should be done to…

The correct answer is B. Use aws cloudformation package to upload the source code to an Amazon S3 bucket and. The AWS SAM (Serverless Application Model) template shown uses Transform: AWS::Serverless-2016-10-31, which requires preparing the Lambda source code for deployment using the command: aws cloudformation package --template-file template.yaml --s3-bucket YOUR_BUCKET_NAME…

Submitted by hans_de· Mar 5, 2026Deployment

Question

Given the source code for an AWS Lambda function in the local file store.py containing a handler function called get_store and the following AWS CloudFormation template:

What should be done to prepare the template so that it can be deployed using the AWS CLI command aws cloudformation deploy?

Exhibits

DVA-C02 question #744 exhibit 1
DVA-C02 question #744 exhibit 2

Options

  • AUse aws cloudformation compile to base64 encode and embed the source file into a modified
  • BUse aws cloudformation package to upload the source code to an Amazon S3 bucket and
  • CUse aws lambda zip to package the source file together with the CloudFormation template and
  • DUse aws server less create-package to embed the source file directly into the existing

How the community answered

(31 responses)
  • A
    6% (2)
  • B
    77% (24)
  • C
    13% (4)
  • D
    3% (1)

Explanation

The AWS SAM (Serverless Application Model) template shown uses Transform: AWS::Serverless-2016-10-31, which requires preparing the Lambda source code for deployment using the command: aws cloudformation package --template-file template.yaml --s3-bucket YOUR_BUCKET_NAME -- output-template-file packaged.yaml This command uploads the source code (e.g., store.py) to an S3 bucket and replaces the CodeUri in the template with a reference to the S3 location, producing a modified CloudFormation template that can then be deployed using aws cloudformation deploy.

Community Discussion

No community discussion yet for this question.

Full DVA-C02 Practice