A developer is scripting an automated deployment for a serverless app and wants to use an existing AWS Serverless Application Model (SAM) template. Which of the following should the developer use? (Choose two.)
Choose an answer
Tap an option to check your answer.
Correct answer: Run aws cloudformation package to create the deployment artifact, then run aws cloudformation deploy to deploy it., Run sam package to create the deployment artifact, then run sam deploy to deploy it..
Why this is the answer
Both aws cloudformation and sam CLI commands can be used for deploying SAM applications. sam package and aws cloudformation package prepare the deployment artifact by uploading local assets (like Lambda function code) to an S3 bucket and transforming the SAM template into a CloudFormation template. Subsequently, sam deploy or aws cloudformation deploy use this processed template to create or update the CloudFormation stack, deploying the serverless application. The other options are incorrect because aws lambda update-function-code is for updating individual Lambda functions, not deploying an entire SAM application; aws serverlessrepo create-application is for publishing to the Serverless Application Repository, not deploying; and directly using aws cloudformation create-stack with a local ZIP package doesn't handle the SAM template transformation or asset uploading.
Pass your exam — without the endless answer hunt
Get every verified question and explanation for this exam in one place, and save hours of prep. 1,000+ certifications · 20+ languages · free to start.
Pass your exam faster → No card needed