🏗️ AWS CloudFormation - DVA-C02 Practice Questions

Define infrastructure as code with CloudFormation templates, stacks, change sets, nested stacks, drift detection, stack policies, custom resources, and SAM integration.

26Questions Available
1Exam Domains

Practice CloudFormation Questions Now

Start a timed practice session focusing on AWS CloudFormation topics from the DVA-C02 question bank.

Start DVA-C02 Practice Quiz →

DVA-C02 CloudFormation Question Bank (26 Questions)

Browse all 26 practice questions covering AWS CloudFormation for the DVA-C02 certification exam. Answers are intentionally hidden on this page so you can self-test first before checking results in quiz mode.

  1. Question 1Deployment

    A developer uses AWS SAM to define a serverless application. Which CloudFormation transform is required in the template?

    AAWS::CloudFormation::Transform
    BAWS::Serverless-2016-10-31
    CAWS::Lambda::Transform
    DAWS::SAM::Application

    Answer hidden for practice.

    Use the interactive quiz to reveal the correct answer and explanation.

    Start DVA-C02 Quiz
  2. Question 2Deployment

    A developer needs to pass sensitive configuration values to a CloudFormation stack without storing them in the template. Which parameter type should they use?

    AString parameter with NoEcho: true
    BAWS::SSM::Parameter::Value::String referencing a Parameter Store SecureString
    CEmbedded Secrets Manager ARN
    DLambda-backed custom resource

    Answer hidden for practice.

    Use the interactive quiz to reveal the correct answer and explanation.

    Start DVA-C02 Quiz
  3. Question 3Deployment

    A developer wants to deploy a CloudFormation stack across multiple accounts and regions from a single template. Which feature handles this?

    ACloudFormation Nested Stacks
    BCloudFormation StackSets
    CCloudFormation Cross-Stack References
    DCloudFormation Macros

    Answer hidden for practice.

    Use the interactive quiz to reveal the correct answer and explanation.

    Start DVA-C02 Quiz
  4. Question 4Deployment

    A developer uses CloudFormation Nested Stacks. The root stack creates child stacks. What is a key operational consideration?

    AChild stacks cannot have outputs
    BChanges to the root stack template do not propagate to child stacks
    CDeleting the root stack also deletes all child stacks
    DChild stacks must be in the same region

    Answer hidden for practice.

    Use the interactive quiz to reveal the correct answer and explanation.

    Start DVA-C02 Quiz
  5. Question 5Deployment

    A developer uses CloudFormation. A Lambda function requires the ARN of an SNS topic created in the same template. Which method is MOST appropriate?

    AHardcode a placeholder ARN
    BUse Ref (for SNS topic ARN) or Fn::GetAtt in the Lambda environment variables
    CCreate the SNS topic in a separate stack
    DUse a CloudFormation mapping with the ARN

    Answer hidden for practice.

    Use the interactive quiz to reveal the correct answer and explanation.

    Start DVA-C02 Quiz
  6. Question 6Deployment

    A team needs to deploy the same application stack to multiple AWS regions with different configurations per region. Which CloudFormation approach is most appropriate?

    ACreate separate templates for each region
    BUse CloudFormation StackSets with parameter overrides per region
    CManually provision resources in each region
    DUse a single stack with conditional resources

    Answer hidden for practice.

    Use the interactive quiz to reveal the correct answer and explanation.

    Start DVA-C02 Quiz
  7. Question 7Troubleshooting and Optimization

    A developer wants to check if a CloudFormation stack drift has occurred (resources changed outside of CloudFormation). Which feature detects this?

    ACloudFormation change sets
    BCloudFormation drift detection
    CAWS Config
    DCloudTrail event analysis

    Answer hidden for practice.

    Use the interactive quiz to reveal the correct answer and explanation.

    Start DVA-C02 Quiz
  8. Question 8Deployment

    A developer uses SAM and wants to include shared infrastructure (e.g., a VPC) defined in a separate CloudFormation stack. Which SAM/CloudFormation feature is used?

    ASAM nested applications
    BCloudFormation cross-stack references with Fn::ImportValue
    CCloudFormation StackSets
    DSAM global settings

    Answer hidden for practice.

    Use the interactive quiz to reveal the correct answer and explanation.

    Start DVA-C02 Quiz
  9. Question 9Deployment

    A developer uses CloudFormation to create a Lambda function. The function needs the ARN of an SQS queue created in the same stack. How should they reference it?

    AHardcode the SQS queue ARN
    BUse Fn::GetAtt: [MySQSQueue, Arn]
    CUse a CloudFormation Mapping
    DUse a Parameter for the SQS ARN

    Answer hidden for practice.

    Use the interactive quiz to reveal the correct answer and explanation.

    Start DVA-C02 Quiz
  10. Question 10Deployment

    Which AWS CDK command synthesizes a CDK app into a CloudFormation template?

    Acdk deploy
    Bcdk diff
    Ccdk synth
    Dcdk bootstrap

    Answer hidden for practice.

    Use the interactive quiz to reveal the correct answer and explanation.

    Start DVA-C02 Quiz
  11. Question 11Deployment

    A CloudFormation template creates an S3 bucket. A developer wants to prevent accidental deletion. Which CloudFormation attribute enables this?

    ADeletionPolicy: Retain
    BUpdateReplacePolicy: Delete
    CDependsOn: S3Bucket
    DDeletionPolicy: Snapshot

    Answer hidden for practice.

    Use the interactive quiz to reveal the correct answer and explanation.

    Start DVA-C02 Quiz
  12. Question 12Deployment

    A developer uses CloudFormation to deploy an ECS service. The task definition references an ECR image. How should the image tag be managed in the template?

    AUse 'latest' tag always
    BUse a specific image tag or digest, or use a CloudFormation parameter for the tag
    CUse the ECR repository URI without a tag
    DUse a Lambda custom resource to get the latest tag

    Answer hidden for practice.

    Use the interactive quiz to reveal the correct answer and explanation.

    Start DVA-C02 Quiz
  13. Question 13Troubleshooting and Optimization

    A developer wants to verify that a CloudFormation template change will not replace or delete critical resources before deploying. Which feature provides this?

    ACloudFormation drift detection
    BCloudFormation change sets
    CCloudFormation stack policies
    DCloudFormation rollback triggers

    Answer hidden for practice.

    Use the interactive quiz to reveal the correct answer and explanation.

    Start DVA-C02 Quiz
  14. Question 14Deployment

    A developer wants to test a CloudFormation change set before executing it. Which feature shows the exact diff between current and proposed resource states?

    ACloudFormation drift detection
    BCloudFormation change set with detailed change information
    CCDK diff
    DAWS Config rule evaluation

    Answer hidden for practice.

    Use the interactive quiz to reveal the correct answer and explanation.

    Start DVA-C02 Quiz
  15. Question 15Deployment

    A CloudFormation stack update fails. What does CloudFormation do by default?

    ALeaves the stack in a FAILED state
    BRolls back to the previous successful state
    CDeletes the entire stack
    DSkips the failed resource and continues

    Answer hidden for practice.

    Use the interactive quiz to reveal the correct answer and explanation.

    Start DVA-C02 Quiz
  16. Question 16Deployment

    A developer uses CloudFormation cross-stack references. Which functions allow exporting and importing values between stacks?

    AFn::GetAtt and Fn::Sub
    BOutputs with Export and Fn::ImportValue
    CParameters and Ref
    DMappings and Conditions

    Answer hidden for practice.

    Use the interactive quiz to reveal the correct answer and explanation.

    Start DVA-C02 Quiz
  17. Question 17Deployment

    A CloudFormation stack fails to create due to a missing IAM permission. The developer fixes the permission and re-runs the deployment. What does CloudFormation do with resources created before the failure?

    ALeaves them as-is from the first attempt
    BRolls them back, then re-creates all resources in the new attempt
    CSkips re-creating them since they already exist
    DDeletes the stack and requires a fresh deployment

    Answer hidden for practice.

    Use the interactive quiz to reveal the correct answer and explanation.

    Start DVA-C02 Quiz
  18. Question 18Deployment

    A developer uses CloudFormation and wants to execute custom provisioning logic during stack create/update. Which resource type allows this?

    ACloudFormation Macro
    BAWS::CloudFormation::CustomResource backed by Lambda
    CCloudFormation StackSet
    DCloudFormation drift detection

    Answer hidden for practice.

    Use the interactive quiz to reveal the correct answer and explanation.

    Start DVA-C02 Quiz
  19. Question 19Deployment

    A CloudFormation stack needs to create resources in a specific order. Resource B depends on Resource A's ARN. How should this dependency be expressed?

    AUse CreationPolicy on Resource B
    BUse DependsOn attribute on Resource B, or use Ref/Fn::GetAtt which implicitly creates dependencies
    CUse a WaitCondition
    DUse Mappings section

    Answer hidden for practice.

    Use the interactive quiz to reveal the correct answer and explanation.

    Start DVA-C02 Quiz
  20. Question 20Deployment

    Which CloudFormation resource enables a developer to wait for an EC2 instance to complete initialization (e.g., run user data scripts) before the stack proceeds?

    AAWS::CloudFormation::WaitCondition with a WaitConditionHandle
    BCreationPolicy on the EC2 instance with cfn-signal
    CDependsOn with a sleep parameter
    DAWS::CloudFormation::Init

    Answer hidden for practice.

    Use the interactive quiz to reveal the correct answer and explanation.

    Start DVA-C02 Quiz
  21. Question 21Deployment

    A developer uses CloudFormation and wants to deploy an RDS instance. Which DeletionPolicy protects against accidental data loss if the stack is deleted?

    ADeletionPolicy: Delete
    BDeletionPolicy: Retain
    CDeletionPolicy: Snapshot
    DDeletionPolicy: Backup

    Answer hidden for practice.

    Use the interactive quiz to reveal the correct answer and explanation.

    Start DVA-C02 Quiz
  22. Question 22Deployment

    A developer wants to prevent certain CloudFormation resources from being deleted when a stack is updated. Which resource attribute provides this protection?

    AUpdateReplacePolicy: Retain
    BDeletionPolicy: Retain
    CMetadata: DeletionProtection
    DCreationPolicy

    Answer hidden for practice.

    Use the interactive quiz to reveal the correct answer and explanation.

    Start DVA-C02 Quiz
  23. Question 23Deployment

    A developer uses CloudFormation to update a stack. The update requires replacing an EC2 instance. How can the developer minimize disruption?

    AUse a change set and review the replacement before applying
    BUpdate the stack without reviewing
    CDelete and recreate the stack
    DUse cfn-init to update in place

    Answer hidden for practice.

    Use the interactive quiz to reveal the correct answer and explanation.

    Start DVA-C02 Quiz
  24. Question 24Deployment

    A developer creates a SAM template with an API Gateway and Lambda. After deployment, they update only the Lambda function code. What is the FASTEST way to redeploy?

    Asam deploy
    Bsam sync --code (deploys only the code change, bypassing CloudFormation)
    Caws cloudformation update-stack
    DManually zip and upload to Lambda

    Answer hidden for practice.

    Use the interactive quiz to reveal the correct answer and explanation.

    Start DVA-C02 Quiz
  25. Question 25Deployment

    A developer builds a microservices application. Each service has its own CloudFormation stack. How should they manage shared infrastructure like a VPC?

    ADuplicate the VPC definition in each stack
    BCreate a shared infrastructure stack and export the VPC/subnet IDs for other stacks to import
    CUse CloudFormation StackSets for the VPC
    DHardcode VPC IDs in each stack's parameters

    Answer hidden for practice.

    Use the interactive quiz to reveal the correct answer and explanation.

    Start DVA-C02 Quiz
  26. Question 26Select All That ApplyDeployment

    A developer uses AWS SAM and wants to define environment-specific settings (dev vs prod) without changing the template. Which SAM feature supports this?

    ASAM Globals
    BSAM configuration file (samconfig.toml) with multiple environments
    CSAM Policy Templates
    DCloudFormation parameter overrides in sam deploy

    Answer hidden for practice.

    Use the interactive quiz to reveal the correct answer and explanation.

    Start DVA-C02 Quiz

Key CloudFormation Concepts for DVA-C02

cloudformationtemplatestackchange setnested stackdriftcustom resourcesamiac

DVA-C02 CloudFormation Exam Tips

AWS CloudFormation questions in DVA-C02 are typically scenario-based. Focus on application development patterns, event-driven integration, and secure coding on AWS. Priority concepts: cloudformation, template, stack, change set, nested stack, drift.

What DVA-C02 Expects

  • Anchor your answer in select developer-friendly managed services and patterns that minimize custom undifferentiated code.
  • CloudFormation scenarios for DVA-C02 are frequently mapped to Domain 3 (24%), so read the objective carefully before picking controls or architecture.
  • Expect multi-topic scenarios where CloudFormation interacts with IAM, networking, storage, or observability patterns rather than appearing as an isolated question.
  • When two options are both technically valid, prefer the choice that best aligns with the exam's operational scope (Associate) and vendor best practices.

High-Value CloudFormation Concepts

  • Know the core CloudFormation building blocks cold: cloudformation, template, stack, change set.
  • Review the edge-case features and limits for nested stack, drift; these details are commonly used to differentiate answer choices.
  • Practice service-integration reasoning: how CloudFormation pairs with SAM, CDK, Elastic Beanstalk in real deployment patterns.
  • For DVA-C02, explain why the chosen CloudFormation design meets reliability, security, and cost expectations better than the alternatives.

Common DVA-C02 Traps

  • Watch for using infrastructure-centric answers instead of application-centric ones.
  • Questions in Deployment often include distractors that look correct for CloudFormation but violate least-privilege, durability, or availability requirements.
  • Avoid picking options purely by feature name; validate data path, failure handling, and governance impact before answering.
  • If the prompt hints at automation or repeatability, eliminate manual-only operational answers first.

Fast Review Checklist

  • Can you compare at least two CloudFormation implementation paths and justify which one best fits the scenario?
  • Can you map the chosen answer back to Deployment (24%) outcomes for DVA-C02?
  • Can you explain security and access boundaries for CloudFormation without relying on default-open assumptions?
  • Can you describe how CloudFormation integrates with SAM and CDK during failure, scaling, and monitoring events?

Exam Domains Covering CloudFormation

Related Resources

More DVA-C02 Study Resources