Courseiva
Configuration Management and IaCeasyMultiple ChoiceObjective-mapped

DOP-C02 Configuration Management and IaC Practice Question

A developer wants to provision AWS resources using AWS Cloud Development Kit (CDK) and ensure that the infrastructure can be version-controlled and reviewed. Which practice should they follow?

⚠ Common exam trap

Candidates often think CDK requires manual synthesis or that it can output Terraform, but the exam tests that CDK is a CloudFormation-only IaC tool that must be synthesized and version-controlled as code, not as raw templates.

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

Write the CDK app in TypeScript, store it in a Git repository, and use CDK pipelines for deployment.

It follows the recommended practice of treating CDK application code as infrastructure source code, storing it in a version control system (Git), and using CDK Pipelines (a high-level construct that automatically synthesizes and deploys CloudFormation templates) to ensure repeatable, reviewed deployments. This approach enables infrastructure-as-code best practices: version history, peer review via pull requests, and automated deployment pipelines.

Answer analysis

Option-by-option breakdown

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

  • Write the CDK app and deploy directly without synthesis to avoid extra steps.

    Why it's wrong here

    AWS CDK does not have a deploy path that bypasses synthesis; the `cdk deploy` CLI command invokes the AWS CDK synthesizer to generate CloudFormation templates in memory before making any deployment API call. The framework requires this intermediate representation so that AWS CloudFormation can orchestrate resource provisioning, rollbacks, and change sets. There is no 'direct deploy' toggle, and avoiding synthesis would also eliminate the built-in validation, asset handling, and IAM policy generation that happen during synthesis.

  • Write the CDK app to generate Terraform configurations and store them in Git.

    Why it's wrong here

    The AWS CDK's synthesis engine emits CloudFormation templates (JSON or YAML), not Terraform HCL configuration files; the 'CDK for Terraform' project is a separate tool under the HashiCorp ecosystem, not the AWS CDK. Generating Terraform configurations would require a different framework entirely and would break the integration with CloudFormation-native features like stacks, change sets, and the event-driven console history. While storing generated configurations in Git is a fine versioning practice, the stated workflow incorrectly replaces the CDK's target format and would not produce deployable output through AWS-native services.

  • Write raw CloudFormation templates instead of CDK to simplify version control.

    Why it's wrong here

    Writing raw CloudFormation templates removes the CDK's ability to synthesise infrastructure from high-level programming language constructs, thereby forfeiting the imperative logic and abstraction that enable modular, testable code for version control. This approach is tempting because CloudFormation templates are the native, declarative format that AWS directly deploys, and they would be the correct choice if the developer required strict adherence to a YAML/JSON-only pipeline without the CDK's synthesis step.

  • Write the CDK app in TypeScript, store it in a Git repository, and use CDK pipelines for deployment.

    Why this is correct

    Storing an ordinary TypeScript CDK project in Git and using the `cdk pipelines` construct creates a self-mutating CI/CD pipeline that automatically builds, synthesizes, and deploys the app to one or more AWS environments. This approach lets you version the CDK source, review pull requests, run unit tests, and retain the full CloudFormation deployment model underneath. It is the recommended production pattern because pipeline updates are also managed through the same CDK code, giving you repeatable and auditable infrastructure delivery.

About these practice questions

Courseiva writes every DOP-C02 question from scratch — 251 in total, each with an explanation and a wrong-answer breakdown. None are copied from real exams or 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 DOP-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 DOP-C02 exam.