INFRASTRUCTURE LEARNINGINFRASTRUCTURE LEARNING
インフラ大全インフラ大全IT INFRASTRUCTURE / LEARNING
Infrastructure learning guide
Find a lesson or lab/

Esc to close · Search terms stay on your device

LEARNING日本語

Topic lessonTopic: IaC selection and existing-resource adoption

CloudFormation vs AWS CDK vs Terraform: choosing and planning adoption

CloudFormation centers on templates, AWS CDK generates CloudFormation deployment artifacts from code, and Terraform uses providers and state. Compare review artifacts, ownership and team operations rather than choosing by popularity.

What you will learn

Compare approaches against the same requirements and explain checks needed before importing existing resources or changing management tools.

Prerequisite

Knowledge of IaC, CloudFormation change review, CDK synthesis and Terraform plan/apply/state helps. This lesson does not ask you to install every tool.

Compare execution models as well as authoring syntax

Compare authoring, review and management
AxisCloudFormationAWS CDKTerraform
Primary authoringJSON/YAML templatesSupported language code and constructsConfiguration such as HCL, plus providers
Review artifactsTemplates and proposed changesCode, generated templates/assets and changesConfiguration, inputs, providers and plans
Management modelCloudFormation stacks and resourcesCloudFormation applies synthesized infrastructureState mappings and provider operations
Operational checksTarget stack, permissions, changes and failuresThose checks plus app execution, dependencies and synthesisBackend, locking, provider coverage and partial failure

CDK and CloudFormation are not two unrelated deployment engines. Moving to Terraform also changes how managed objects are recorded and owned; it is more than a syntax rewrite.

The same report system can have different team requirements

Candidates and unresolved checks
ConditionCandidate and reasonStill verify
Existing AWS stacks, reviewed by a team comfortable with YAMLConsider retaining CloudFormation and its established review workflow.Resource coverage, change impact and remaining operational needs.
Reusable TypeScript building blocks while retaining CloudFormation managementConsider CDK, reviewing generated artifacts as well as reusable code.Dependencies, app execution, generated resources and stable logical IDs.
One plan-review workflow across multiple servicesEvaluate Terraform against the required providers.Specific resource/property/version support, state ownership and backend.

These candidates are design judgments for the stated conditions. Do not assume universal resource, property, Region or version coverage. Retaining an established workflow can be the appropriate choice.

Define ownership and review before choosing tools

An adoption review shared by all three approaches
An adoption review shared by all three approaches1: Identify requirements — Align scope — Define ownership. 2: Define ownership — Make responsibility explicit — Review proposed changes. 3: Review proposed changes — Apply and inspect — Verify after execution123IdentifyrequirementsDefine ownershipReview proposedchangesVerify afterexecutionAn adoption review shared by all three approaches1: Identify requirements — Align scope — Define ownership. 2: Define ownership — Make responsibility explicit — Review proposed changes. 3: Review proposed changes — Apply and inspect — Verify after execution123IdentifyrequirementsDefineownershipReview proposedchangesVerify afterexecution
  1. Identify requirements → Define ownershipAlign scope
  2. Define ownership → Review proposed changesMake responsibility explicit
  3. Review proposed changes → Verify after executionApply and inspect
Identify requirements
Targets, team and constraints
Define ownership
Responsibility for objects and settings
Review proposed changes
Artifacts, differences and impact
Verify after execution
Outcomes, functions and data

Avoid having multiple systems concurrently write the same settings of the same object. Referencing an existing object is different from adopting it for managed updates. Record read-only references separately from write ownership.

Adoption requires mappings and the next proposed change

Import entry points and conditions
ApproachBefore importAfter import
CloudFormationSupported identifiers, a template modeling current configuration, and DeletionPolicy.Stack mapping, actual configuration and the impact of the next update.
CDKConstructs modeling current state and the cdk import restriction on unrelated changes.Generated templates, resource mappings and unintended differences.
TerraformThe resource identity and destination resource address/configuration.One-to-one state mapping and changes proposed by the next plan.

Import is not an automatic conversion of configuration and data into your desired state. Read resource-specific support and constraints, then inspect differences for unintended changes to existing configuration. No import command or live operation is performed here.

Separate management migration from data recovery

Three separate migration outcomes
OutcomeRequired checks
Management adoptedResource identity, ownership, configuration, records and differences.
Application usableEndpoints, permissions, communication and required functions.
Data recoverableStored contents, recovery points, destinations, consistency and recovery procedure.
  1. Record target resources/properties, existing ownership and reasons for accepting or rejecting options.
  2. Design artifact/plan review, secret flows, permissions and concurrency controls.
  3. Prepare adoption, cutover, failure decisions and verification, starting with a testable scope.
  4. Verify resources, applications and data using evidence appropriate to each.

Check your reasoning against requirements

Choose an option to see the result and explanation.

Does choosing CDK remove CloudFormation from the management model?
Read the answer and reason

Answer: No; inspect synthesized artifacts and their CloudFormation deployment · Compare the authoring language separately from the deployment mechanism.

A YAML-skilled team safely maintains existing stacks. Must it switch languages?
Read the answer and reason

Answer: Evaluate the need; retaining the workflow is an option · Popularity alone is not a reason to discard an adequate workflow.

Does Terraform guarantee every property of every desired service?
Read the answer and reason

Answer: No; verify required provider and target support · A shared workflow and actual coverage require separate evaluation.

Is it safer for two tools to manage the same setting concurrently?
Read the answer and reason

Answer: No; define write ownership and scope · Separate references from write ownership to avoid unintended conflicts.

A resource import completed. Has yesterday’s data been restored?
Read the answer and reason

Answer: No; management adoption and data restoration differ · Mapping a managed object does not establish restoration of past data.

The next update proposes unexpected replacement after import. Is import success enough to proceed?
Read the answer and reason

Answer: Stop and reconcile actual configuration, code and mappings · Investigate unintended replacement or changes before the next execution.

Check, then explain in your own words

  1. Separate authoring from deployment in the comparison table.
  2. Explain candidates and unresolved checks for the three team cases.
  3. Check adoption and recovery boundaries in the questions and review.
Check your understanding: What evidence should an IaC selection proposal retain?

Record scope and ownership, team review practices, required resource coverage, state and secret handling, adoption and subsequent differences, failure decisions and function/data verification.

Convenient syntax alone cannot establish workable deployment and maintenance conditions.

Sources and conditions checked

The official references used in this lesson are collected here with their scope, conditions and corresponding sections. Independent expert review and live AWS comparison have not been performed.