How to Deploy AWS SAM Templates Using CloudFormation?
A company is adopting serverless computing for some of its new services. A development team needs to create a serverless infrastructure by using AWS Serverless Application Model (AWS SAM). All infrastructure must be deployed by using AWS CloudFormation templates. What should the development team do to meet these requirements?
Community Votes
100% of anonymous learners picked answer C. Votes are pick records left by other test-takers — they are not the verified answer.
Community Insight
This question tests knowledge of how SAM integrates with native CloudFormation, specifically the mandatory Transform directive, while trapping candidates who confuse resource types or template sections.
AWS SAM extends CloudFormation by allowing developers to write serverless resources in simplified YAML or JSON syntax. The community unanimously agrees that adding a Transform section to the CloudFormation template is the required step to enable this functionality.
Option A is frequently chosen because it uses standard CloudFormation Lambda resource types, but it fails to leverage the simplified SAM macros and requires manual configuration of API Gateway, IAM roles, and permissions instead of using AWS::Serverless::Function.
Community Discussion (8 comments)
Comments & Corrections
No comments yet — spotted an error or have a note? Share it below.
Expert Analysis
Why the Answer Is Correct
AWS SAM is fundamentally a macro language built on top of CloudFormation. To use SAM-specific resource types like AWS::Serverless::Function or AWS::Serverless::API, you must declare the Transform directive at the root level of your CloudFormation template. This tells CloudFormation to pre-process the template and translate SAM macros into native CloudFormation resources before deployment. Without this directive, CloudFormation will reject the template as invalid.Why the Other Options Are Wrong
Option A incorrectly suggests using native AWS::Lambda::Function resources, which bypasses SAM entirely and defeats the purpose of using the framework. Option B misplaces SAM resource definitions inside the Mappings section, which is strictly for key-value lookups and cannot hold resource configurations. Option D incorrectly associates SAM globals with the Parameters section, whereas globals belong in a dedicated Globals block that applies settings across multiple functions.Community Comment Notes
Candidates overwhelmingly confirmed option C through practical examples shared in the discussion. Comment [3] provided a complete template structure demonstrating the exact Transform directive syntax required. Multiple users noted they encountered this exact wording during their recent DVA-C02 exams, validating its high relevance. The official AWS documentation link shared in comment [1] further corroborates the necessary template structure.Official Reference
Exam Strategy
Memorize the exact syntax for the Transform directive, as AWS frequently tests this foundational integration point. When reviewing infrastructure-as-code questions, always verify whether the question explicitly requests a higher-level abstraction like SAM or CDK, as this dictates which template sections and resource prefixes are valid.
Related Analysis
Practice All DVA-C02 Questions
Access 100 questions with complete answers and detailed explanations.
View Full DVA-C02 Practice Test →