DVA-C02 · Question #549
A developer needs to automate deployments for a serverless, event-based workload. The developer needs to create standardized templates to define the infrastructure and to test the functionality of the
The correct answer is A. Create an AWS Serverless Application Model (AWS SAM) template. Configure the pipeline. AWS SAM provides serverless-specific CloudFormation shorthand templates and the sam local command for local testing, and integrates natively with existing CodePipeline pipelines.
Question
A developer needs to automate deployments for a serverless, event-based workload. The developer needs to create standardized templates to define the infrastructure and to test the functionality of the workload locally before deployment. The developer already uses a pipeline in AWS CodePipeline. The developer needs to incorporate any other infrastructure changes into the existing pipeline. Which solution will meet these requirements?
Options
- ACreate an AWS Serverless Application Model (AWS SAM) template. Configure the pipeline
- BCreate an AWS Step Functions workflow template based on the infrastructure by using the
- CCreate an AWS CloudFormation template. Use the existing pipeline workflow to build a pipeline
- DCreate an AWS Serverless Application Model (AWS SAM) template. Use an automated script to
How the community answered
(59 responses)- A78% (46)
- B12% (7)
- C3% (2)
- D7% (4)
Why each option
AWS SAM provides serverless-specific CloudFormation shorthand templates and the `sam local` command for local testing, and integrates natively with existing CodePipeline pipelines.
AWS SAM extends CloudFormation with simplified resource types (AWS::Serverless::Function, etc.) designed for event-driven serverless workloads. The SAM CLI enables local invocation and testing of Lambda functions before deployment. SAM templates deploy via CloudFormation, making them directly compatible with an existing CodePipeline pipeline using the CloudFormation deploy action.
AWS Step Functions workflow templates define runtime execution logic, not infrastructure; they cannot define or deploy Lambda functions or other infrastructure resources.
Standard CloudFormation templates do not include native local testing capabilities for serverless workloads; SAM is the purpose-built tool that adds this functionality on top of CloudFormation.
Using an automated script to deploy outside of the existing CodePipeline pipeline contradicts the requirement to incorporate infrastructure changes into the existing pipeline.
Concept tested: AWS SAM for serverless infrastructure templates and local testing
Source: https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/what-is-sam.html
Community Discussion
No community discussion yet for this question.