Courseiva
DeploymenteasyMultiple SelectObjective-mapped

DVA-C02 Deployment Practice Question

A developer is deploying a serverless application using the AWS Serverless Application Model (SAM). The application includes an Amazon DynamoDB table and a Lambda function that reads from the table. The developer wants to define the DynamoDB table and the Lambda function in the SAM template. Which THREE resource types should the developer include in the template? (Choose THREE.)

Answer choices

Why each option matters

Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.

Correct answer & explanation

AWS::DynamoDB::Table

The correct options are A (AWS::DynamoDB::Table), D (AWS::Serverless::SimpleTable), and E (AWS::Serverless::Function). In an AWS SAM template, you can define a DynamoDB table using either the standard CloudFormation resource AWS::DynamoDB::Table (for full control) or the SAM shorthand AWS::Serverless::SimpleTable (for simpler use cases). For a Lambda function, the recommended SAM resource is AWS::Serverless::Function, which provides additional SAM features like event mappings and policies. Option B (AWS::Lambda::Function) is a CloudFormation resource that could be used but is not the typical SAM choice; the question asks for resource types to include in a SAM template, so the serverless type is expected. Option C (AWS::Serverless::DynamoDB) is not a valid AWS resource type.

Answer analysis

Option-by-option breakdown

For each option: why learners choose it and why it is or isn't the right answer here.

  • AWS::DynamoDB::Table

    Why this is correct

    AWS::DynamoDB::Table is a native CloudFormation resource that can be embedded directly in a SAM template. It gives you full control over DynamoDB settings such as key schema, billing mode, global secondary indexes, and stream specification, whereas SAM's Serverless::SimpleTable only exposes a subset of these properties. Using this resource is appropriate when you need advanced configuration, like TTL or point-in-time recovery, without leaving the template.

  • AWS::Lambda::Function

    Why it's wrong here

    AWS::Lambda::Function is a valid CloudFormation resource, but SAM templates are designed to leverage the AWS::Serverless::Function resource instead. The SAM resource adds convenience features like event source mappings, inline code translation, and auto-generated IAM roles, which plain Lambda::Function lacks. Using Lambda::Function directly would force you to manually construct permissions and event sources, defeating the purpose of SAM's simplified deployment model.

  • AWS::Serverless::DynamoDB

    Why it's wrong here

    AWS::Serverless::DynamoDB is not a recognized resource type in the AWS Serverless Application Model. The SAM specification only includes AWS::Serverless::Function, AWS::Serverless::Api, AWS::Serverless::HttpApi, and AWS::Serverless::SimpleTable (along with a few others) for serverless resources. If you attempt to declare this resource, CloudFormation will fail template validation because no such transformation exists in the SAM namespace.

  • AWS::Serverless::SimpleTable

    Why this is correct

    AWS::Serverless::SimpleTable is a SAM-native resource that generates a DynamoDB table with minimal configuration, requiring only a table name and a primary key definition. It automatically sets the billing mode to PAY_PER_REQUEST and skips advanced features like secondary indexes, making it ideal for quick prototypes. For production workloads needing more control, you can expand it or use the full AWS::DynamoDB::Table resource in the same template.

  • AWS::Serverless::Function

    Why this is correct

    AWS::Serverless::Function is the core resource type in SAM for defining Lambda functions, providing a simplified syntax that handles IAM roles, event source mappings, and code packaging automatically. It supports a concise Events property to connect triggers like API Gateway, S3, SQS, and DynamoDB Streams without writing separate CloudFormation resources. While AWS::Lambda::Function is valid, the SAM version is the preferred way to deploy serverless functions in a SAM template.

Quick reference

Cloud Service Model Comparison

ModelYou ManageProvider ManagesExamples
IaaSOS, runtime, apps, dataHardware, hypervisor, networkingEC2, Azure VMs, GCP Compute Engine
PaaSApps and dataOS, runtime, middleware, hardwareElastic Beanstalk, Azure App Service
SaaSData and settings onlyEverything elseMicrosoft 365, Salesforce, Workday
FaaS / ServerlessFunction code onlyInfra, scaling, runtimeLambda, Azure Functions, Cloud Run
CaaSContainers and appsKubernetes, OS, hardwareEKS, AKS, GKE

About these practice questions

This DVA-C02 question is part of Courseiva's 724-question bank — original exam-style content with full explanations and wrong-answer analysis, never real exam questions or exam dumps. Learn why practice questions differ from exam dumps →

How Courseiva writes practice questions · Editorial policy

JA

Written by Johnson Ajibi, MSc IT Security

Senior Network & Security Engineer · founder of Courseiva

This DVA-C02 practice question is part of Courseiva's free Amazon Web Services certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the DVA-C02 exam.