nerdexam
Amazon

DOP-C02 · Question #271

A developer is using the AWS Serverless Application Model (AWS SAM) to create a prototype for an AWS Lambda function. The AWS SAM template contains an AWS::Serverless::Function resource that has the…

The correct answer is C. Update the CodeUri property to reference the local application code folder. Use the sam deploy E. Update the CodeUri property to reference the local application code folder. Use the aws. To resolve the "no changes to deploy" error when updating a Lambda function with SAM, the CodeUri property in the SAM template must be updated to reference the local application code folder, allowing SAM CLI to manage the S3 artifact updates and template changes.

Submitted by jordan8· Mar 6, 2026SDLC Automation

Question

A developer is using the AWS Serverless Application Model (AWS SAM) to create a prototype for an AWS Lambda function. The AWS SAM template contains an AWS::Serverless::Function resource that has the CodeUri property that points to an Amazon S3 location. The developer wants to identify the correct commands for deployment before creating a CI/CD pipeline. The developer creates an archive of the Lambda function code named package.zip. The developer uploads the .zip file archive to the S3 location specified in the CodeUri property. The developer runs the sam deploy command and deploys the Lambda function. The developer updates the Lambda function code and uses the same steps to deploy the new version of the Lambda function. The sam deploy command fails and returns an error of no changes to deploy. Which solutions will deploy the new version? (Choose two.)

Options

  • AUse the aws cloudformation update-stack command instead of the sam deploy command.
  • BUse the aws cloudformation update-stack-instances command instead of the sam deploy
  • CUpdate the CodeUri property to reference the local application code folder. Use the sam deploy
  • DUpdate the CodeUri property to reference the local application code folder. Use the aws
  • EUpdate the CodeUri property to reference the local application code folder. Use the aws

How the community answered

(22 responses)
  • A
    9% (2)
  • B
    5% (1)
  • C
    82% (18)
  • D
    5% (1)

Why each option

To resolve the "no changes to deploy" error when updating a Lambda function with SAM, the `CodeUri` property in the SAM template must be updated to reference the local application code folder, allowing SAM CLI to manage the S3 artifact updates and template changes.

AUse the aws cloudformation update-stack command instead of the sam deploy command.

Using `aws cloudformation update-stack` directly would still result in the "no changes to deploy" error if the `CodeUri` in the template (referencing a static S3 key) does not change.

BUse the aws cloudformation update-stack-instances command instead of the sam deploy
CUpdate the CodeUri property to reference the local application code folder. Use the sam deployCorrect
DUpdate the CodeUri property to reference the local application code folder. Use the aws

The choice is incomplete, but similar to C and E, the core issue is the `CodeUri` pointing to a static S3 key, which needs to be changed to a local reference for SAM to manage correctly.

EUpdate the CodeUri property to reference the local application code folder. Use the awsCorrect

Updating the `CodeUri` property in the SAM template to refer to the local application code folder allows the AWS SAM CLI to correctly package and upload the code to S3 with a unique identifier, ensuring that CloudFormation detects a template change on subsequent deployments and updates the Lambda function.

Concept tested: AWS SAM deployment, Lambda code updates, CloudFormation change detection

Source: https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/sam-property-function-codeuri.html

Topics

#AWS SAM#Serverless deployment#Lambda functions#CI/CD deployment commands

Community Discussion

No community discussion yet for this question.

Full DOP-C02 Practice