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 and CloudFormation: configuration, changes and drift

Infrastructure as code explained: managing AWS configuration and changes

Infrastructure as code (IaC) expresses infrastructure configuration as code so changes can be reviewed and versioned. Saving a file does not itself change AWS. Follow a change through writing the configuration, reviewing the difference, applying it and checking the result.

What you will learn

Distinguish configuration, version history, provisioning and live resources; explain why inputs and target environments matter even with the same file.

Prerequisite

AWS resources are objects you create or configure, such as VPCs and EC2 instances. Git tracks file history. No account creation or command execution is needed here.

Separate configuration, history, provisioning and resources

In CloudFormation, a template declares resource types and settings; a stack groups resources for management. Git history records file changes, while stack operation results describe what happened in AWS. They answer different questions.

Identify each role by what you inspect
RoleWhat to inspectWhat it does not establish
ConfigurationResource definitions, settings, references and inputs.Whether it has been applied.
History and reviewReasons, differences and the reviewed revision.Whether AWS currently matches it.
ProvisioningTarget stack, inputs, permissions and operation results.Whether every application function and its data are correct.
Live resourcesConfiguration, state, application behavior and costs.Whether the rationale was recorded in the repository.

Follow a change from authoring to verification

Connect configuration changes with checks of the live environment
Connect configuration changes with checks of the live environment1: Write configuration — Record changes — Review differences. 2: Review differences — Decide and execute — Apply changes. 3: Apply changes — Verify results — Check resources123Write configurationReview differencesApply changesCheck resourcesConnect configuration changes with checks of the live environment1: Write configuration — Record changes — Review differences. 2: Review differences — Decide and execute — Apply changes. 3: Apply changes — Verify results — Check resources123WriteconfigurationReviewdifferencesApply changesCheck resources
  1. Write configuration → Review differencesRecord changes
  2. Review differences → Apply changesDecide and execute
  3. Apply changes → Check resourcesVerify results
Write configuration
Resources, settings, inputs
Review differences
Reason, impact, target
Apply changes
A provisioning engine
Check resources
Settings, behavior, cost

The diagram shows work, not a network path. With CloudFormation, a change set previews proposed additions, changes and removals. Creating that preview and executing it are separate operations.

The same file can have different inputs and targets

A shared template can produce different outcomes with different parameters, referenced resources, accounts, Regions or permissions. Making a setup reproducible is different from guaranteeing identical results everywhere. Associate inputs and targets with the reviewed revision; keep secrets out of code and outputs.

Review context alongside the code
CheckConcrete question
TargetProduction or test? Are the account, Region and stack correct?
InputsWhich values change and which stay? Are secrets excluded from history?
OwnershipWhich stack or process is responsible for changing this resource?
ImpactCould a change replace or delete resources, alter permissions or affect cost?

Fixed example: changing 80 to 443 in Git

Separate a configuration edit from its deployment result
StageWhat this example establishes
EditAn illustrative connection setting changes from 80 to 443.
Record in GitThe edit is versioned; this is not evidence of an AWS deployment.
ReviewCheck the intended effect against the resource and related settings.
After a real deploymentInspect operation results, endpoints, certificates, application configuration and behavior.

History supports recovery; it does not restore all data

An earlier template helps you review configuration, but applying it may replace or delete resources. Treat configuration changes, data recovery and consumer cutover separately, and check the conditions for each.

This course starts with CloudFormation templates, change sets and drift. Other IaC tools exist; before comparing product names, learn to identify what is managed, what is compared and which operation changes real resources.

Check your understanding of the workflow

Choose an option to see the result and explanation.

A template change was committed to Git. Has AWS necessarily changed?
Read the answer and reason

Answer: No; inspect provisioning and its result separately · A commit records files; deployment targets and operation results establish changes in AWS.

A change set has been created and its differences are visible. What comes next?
Read the answer and reason

Answer: Review the target and impact, then decide whether to execute · Separating preview from execution allows unsuitable changes to be reconsidered.

The same template is used with different inputs and Regions. Must the result be identical?
Read the answer and reason

Answer: No; review inputs and targets as well · Different inputs and targets can change the resulting configuration or operation outcome.

An old template revision is available. Does it guarantee restoration of application data?
Read the answer and reason

Answer: No; verify data-recovery conditions separately · A configuration definition does not establish a data recovery point or a working restore and cutover procedure.

Check, then explain in your own words

  1. Distinguish the four roles using the table.
  2. Explain why a Git edit and an AWS change are separate.
  3. Next, read resources and references in a template.
Check your understanding: Someone says “this infrastructure is managed in Git.” What else should you check?

Match the applied revision, inputs and target stack with provisioning results and checks of resources and applications.

File history alone does not establish where and when a change was applied or the current state.

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.