AWS Certified Developer – Associate (DVA-C02) — Question 411
A developer is creating a script to automate the deployment process for a serverless application. The developer wants to use an existing AWS Serverless Application Model (AWS SAM) template for the application.
What should the developer use for the project? (Choose two.)
Answer options
- A. Call aws cloudformation package to create the deployment package. Call aws cloudformation deploy to deploy the package afterward.
- B. Call sam package to create the deployment package. Call sam deploy to deploy the package afterward.
- C. Call aws s3 cp to upload the AWS SAM template to Amazon S3. Call aws lambda update-function-code to create the application.
- D. Create a ZIP package locally and call aws serverlessrepo create-applicatiion to create the application.
- E. Create a ZIP package and upload it to Amazon S3. Call aws cloudformation create-stack to create the application.
Correct answer: A, B
Explanation
AWS SAM templates can be packaged and deployed using either the AWS CLI (using aws cloudformation package and aws cloudformation deploy) or the AWS SAM CLI (using sam package and sam deploy). Other options like aws lambda update-function-code, aws serverlessrepo create-applicatiion, or uploading a raw ZIP for aws cloudformation create-stack do not natively process AWS SAM templates correctly to deploy the entire serverless application stack.