AWS Certified DevOps Engineer – Professional (DOP-C02) — Question 239
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.)
Answer options
- A. Use the aws cloudformation update-stack command instead of the sam deploy command.
- B. Use the aws cloudformation update-stack-instances command instead of the sam deploy command.
- C. Update the CodeUri property to reference the local application code folder. Use the sam deploy command.
- D. Update the CodeUri property to reference the local application code folder. Use the aws cloudformation create-change-set command and the aws cloudformation execute-change-set command.
- E. Update the CodeUri property to reference the local application code folder. Use the aws cloudformation package command and the aws cloudformation deploy command.
Correct answer: C, E
Explanation
The correct answers, C and E, involve updating the CodeUri property to point to the local application code folder, allowing the deployment commands to recognize the changes. Options A and B do not address the underlying issue of the deployment process, while D introduces unnecessary complexity without solving the problem effectively.