Courseiva
DeploymentmediumMultiple ChoiceObjective-mapped

DVA-C02 Deployment Practice Question

A developer is using AWS SAM to define a serverless application. The application includes an AWS Lambda function and an Amazon API Gateway REST API. The developer wants to configure the API Gateway stage to enable logging and set the stage name based on the SAM parameter Stage. In the SAM template, which property of the AWS::Serverless::Api resource should the developer use to set the stage name?

⚠ Common exam trap

Many candidates confuse `StageName` with `StageDescription` (Option C) because both relate to stage configuration, but `StageDescription` only provides metadata and does not control the actual stage identifier used in the API endpoint URL.

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

StageName

The `StageName` property of the `AWS::Serverless::Api` resource directly sets the stage name for the API Gateway REST API. By using a SAM parameter like `Stage` (e.g., `StageName: !Ref Stage`), the developer can dynamically control the stage name at deployment time. This is the intended and simplest way to configure the stage name in an AWS SAM template.

Answer analysis

Option-by-option breakdown

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

  • StageName

    Why this is correct

    The StageName property within an AWS::Serverless::Api resource in AWS SAM is precisely what defines the name of the Amazon API Gateway deployment stage. This critical property allows developers to specify a logical identifier for a particular deployment, such as Prod, Dev, or Test, which is essential for managing different environments. It frequently leverages SAM parameters, like !Ref Stage, enabling dynamic stage naming based on deployment inputs, ensuring flexibility and reusability across various CI/CD pipelines.

  • DefinitionBody

    Why it's wrong here

    The DefinitionBody property is used to embed the OpenAPI (formerly Swagger) specification directly within the SAM template, defining the API's structure, resources, methods, and integration points. This property dictates the functional contract of the API itself, detailing paths, request/response models, and backend integrations, such as Lambda functions. While fundamental to the API's design, it solely focuses on the API's operational definition and has no role in setting or configuring the API Gateway deployment stage's name.

  • StageDescription

    Why it's wrong here

    The StageDescription property serves purely as a descriptive field for an API Gateway stage, providing human-readable context or notes about that specific deployment stage. Its purpose is to offer additional metadata for administrative clarity within the AWS console or for documentation purposes, helping teams understand the stage's intent or characteristics. However, this property does not influence or determine the actual, functional name by which the API Gateway stage is identified and accessed.

  • EndpointConfiguration

    Why it's wrong here

    The EndpointConfiguration property specifies the type of endpoint for the API Gateway, such as REGIONAL, EDGE, or PRIVATE. This configuration dictates the network architecture and accessibility of the API, influencing latency, cost, and security posture by defining where the API requests are routed and processed. While crucial for the API's global distribution and network setup, it is entirely unrelated to the logical naming of a specific deployment stage within API Gateway.

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

One of 724 original DVA-C02 practice questions on Courseiva, each with a full explanation and wrong-answer analysis — not exam dumps or protected exam content. 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.