exam questions

Exam AWS Certified DevOps Engineer - Professional DOP-C02 All Questions

View all questions & answers for the AWS Certified DevOps Engineer - Professional DOP-C02 exam

Exam AWS Certified DevOps Engineer - Professional DOP-C02 topic 1 question 256 discussion

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.)

  • 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.
Show Suggested Answer Hide Answer
Suggested Answer: CE 🗳️

Comments

Chosen Answer:
This is a voting comment (?). It is better to Upvote an existing comment if you don't have anything to add.
Switch to a voting comment New
trungtd
Highly Voted 9 months, 2 weeks ago
Selected Answer: CE
C. Update the CodeUri property to reference the local application code folder, AWS SAM will handle packaging and uploading the code to S3 during the "sam deploy" command execution. E. - "aws cloudformation package" command packages the local artifacts (such as Lambda function code) and uploads them to an S3 bucket. It then generates a CloudFormation template that references these artifacts. - "aws cloudformation deploy" command deploys the generated CloudFormation template. A. "aws cloudformation update-stack": without the packaging step, it won't recognize changes in the Lambda function code B. used for stack set instances D. without proper packaging of the local code, it may not detect changes correctly.
upvoted 6 times
...
GripZA
Most Recent 1 week ago
Selected Answer: CE
C: When you set the CodeUri in your AWS SAM template to point to a local directory (e.g., CodeUri: ./src/), the sam deploy command automatically packages your application:​ It uploads the local code to an Amazon S3 bucket It updates the cfn template with the new S3 URI It deploys the updated application E: this approach is similar to C but uses AWS cfn commands directly:​ aws cloudformation package uploads your local code to S3 and generates a new template with the updated CodeUri aws cloudformation deploy uses the updated template to deploy your application. this is more manual compared to using sam deploy but achieves the same result
upvoted 1 times
...
jamesf
9 months ago
Selected Answer: CE
Both Option C and Option E provide efficient and reliable methods to deploy updated Lambda function code using AWS SAM and CloudFormation. They address the deployment issue by ensuring that changes are recognized and appropriately handled, facilitating successful code updates in a CI/CD context. By updating the CodeUri to reference the local folder, both approaches ensure that SAM or CloudFormation acknowledges code changes, effectively resolving the "no changes to deploy" error and enabling seamless deployments.
upvoted 4 times
jamesf
9 months ago
Not A as Misfit for Code Changes: - aws cloudformation update-stack is primarily used for updating CloudFormation stack configurations, not for detecting code changes in deployment packages. - It relies on an already packaged and uploaded S3 file specified in the template. Since no template changes are detected, the command would not recognize code updates. Not B as Incorrect Command Context: - aws cloudformation update-stack-instances is designed for AWS CloudFormation StackSets, which are used to manage resources across multiple AWS accounts and regions, not for deploying Lambda functions or single stack updates. - This command is irrelevant to the deployment of a single Lambda function and won't address the issue at hand.
upvoted 1 times
...
...
awsaz
9 months, 1 week ago
Selected Answer: AC
The two correct solutions to deploy the new version of the Lambda function code when sam deploy reports no changes are: A. Use the aws cloudformation update-stack command instead of the sam deploy command. C. Update the CodeUri property to reference the local application code folder. Use the sam deploy command. These approaches ensure that changes to your Lambda function code are correctly identified and deployed without encountering the "no changes to deploy" error.
upvoted 2 times
...
Community vote distribution
A (35%)
C (25%)
B (20%)
Other
Most Voted
A voting comment increases the vote count for the chosen answer by one.

Upvoting a comment with a selected answer will also increase the vote count towards that answer by one. So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.

SaveCancel
Loading ...
exam
Someone Bought Contributor Access for:
SY0-701
London, 1 minute ago