DVA-C02 Question 301
Single answerYou are tasked with deploying a serverless application on AWS that requires a Lambda function, an API Gateway endpoint, and an S3 bucket for static content. The team wants to use Infrastructure as Code (IaC) to manage the deployment. Which AWS service/tool is best suited for this use case, providing a simplified approach specifically tailored for serverless applications?
- A
AWS CloudFormation
- B
AWS Serverless Application Model (AWS SAM)
- C
AWS Cloud Development Kit (AWS CDK)
- D
AWS Amplify
Show answer and explanation
Correct answer: B
Explanation
AWS SAM (Serverless Application Model) is purpose-built for serverless application development and deployment. It extends AWS CloudFormation with simplified syntax and abstractions for common serverless resources, such as Lambda, API Gateway, and S3. While AWS CloudFormation and AWS CDK can also achieve the same result, SAM is specifically optimized for serverless use cases, making it the best choice in this scenario.
- A. Incorrect.
AWS CloudFormation is a powerful IaC tool but does not provide serverless-specific abstractions out of the box. AWS SAM is better suited for this serverless use case.
- B. Correct.
AWS SAM (Serverless Application Model) is specifically designed for building and deploying serverless applications, making it the ideal choice for this scenario.
- C. Incorrect.
AWS CDK can be used to define serverless resources, but it requires writing code and does not provide the same level of serverless-specific simplifications as AWS SAM.
- D. Incorrect.
AWS Amplify is focused on frontend and mobile application development and is not ideal for managing serverless backend resources like Lambda, API Gateway, or S3.