Automating Cloud Resources

Automating Cloud Resources // Cloud+ Field Notes
CompTIA Cloud+ · Objectives 2.4 / 5.1 – 5.4 · Automation & DevOps

Module 8
Automating Cloud Resources

Manual configuration doesn't scale. This module is about making the code the source of truth — IaC and CaC, CI/CD pipelines, Git, Bash, and the DevOps tools that stitch it together.

8 Parts 42 Exam Keywords 4 Interactive Tools Read time ~18 min
ci-cd-pipeline.run
Click a stage to see what happens there.
01

Infrastructure & Configuration as Code

If a change isn't in code, it isn't real — manual edits on individual devices cause the drift IaC exists to prevent.

The source of truth — all changes are made in code, then applied to devices. Manual changes made directly on a device break this model and cause configuration drift.
Imperative
Declarative

IaC vs. CaC

Infrastructure as CodeConfiguration as Code
FocusProvisioning virtualized hardware — servers, routers, firewallsApplication-level configuration
Example toolsAnsible, Puppet, Chef, PowerShellAnsible, Terraform, Chef

Repeatability & drift detection

  • Repeatability — identical deployments, quick recovery, fewer human errors, easier scaling
  • Drift — OS/app versions, patch levels, driver versions, or undocumented hotfixes pulling a device away from its defined baseline

Terraform includes built-in drift detection; AWS Config evaluates cloud resources to identify and manage changes against baseline.

YAML
JSON

        

02

CI/CD Pipelines

Small, frequent, automated integrations replace the old model of massive, infrequent releases.

A developer's change is integrated into the code base, automatically built, tested, and delivered to a repository — ready to deploy. The process repeats for every new component. Delivery means the build lands in a repository; deployment means it's actually installed for consumers.

Testing at every stage

Test typeChecks
UnitIndependent pieces of the application in isolation
IntegrationHow independent pieces work together
SystemThe entire application deployment
AcceptanceAlignment with business requirements

Versioning — semantic format

Major.Minor.Patch — e.g. Linux kernel 6.10.9. Pick one convention, advertise what changed, and explain the format to your users. This is distinct from Git-style version control, covered later in this module.

Documentation debt — skipped documentation isn't neutral — it directly reduces development efficiency and user satisfaction down the line. Build it into the CI/CD requirement, not an afterthought.
03

Automation vs. Orchestration

One task running itself, versus a whole workflow of tasks running itself.

AutomationOrchestration
ScopeA single taskA series of automated tasks as one workflow
TriggerLaunched separately, per stepLaunched once — each step follows automatically
ExampleAuto-install an OS on an instanceCreate instance → install OS → configure → install web service → copy files → start service
Sequencing — orchestration must confirm each step actually completed — e.g., verifying the instance exists — before starting the next one in the chain.

Good automation candidates

  • Routine, repetitive operations (log archiving, account management)
  • Deployments and updates
  • Scaling test/QA environments
  • Scheduled shutdowns and restarts
  • Internal APIs feeding the automation pipeline

Troubleshooting automation failures

  • Version mismatch — managed node OS/app version, or the config tool itself, is wrong
  • Deprecated features — configuration references an OS or app feature that no longer exists
  • Sequencing — check logs to find the last step that completed successfully
  • Authentication — SSH key identities or keys no longer match between systems

Deployment artifacts

  • VM images · container images · executable files · application binaries · libraries · tar/zip bundles · flat files
04

DevOps Tools

Deployment, orchestration, and observability tools — each doing one job well.

ToolRole
AnsibleAgentless, declarative config management via YAML playbooks over SSH
DockerContainer engine; builds images from a Dockerfile
Kubernetes (K8s)Container orchestration — scaling, load balancing, storage, secrets, grouped into pods
ELK StackElasticsearch (search/store) + Logstash (ingest) + Kibana (visualize)
GrafanaDashboard visualization across many data sources
JenkinsCI/CD pipeline tool — build, test, deploy stages via plugins
TerraformDeclarative IaC using HCL; drift detection, execution plans
Ansible ad hoc command vs. playbook
An ad hoc command like ansible server42 -a "/sbin/reboot" runs once, immediately. A playbook (YAML) defines tasks grouped into plays for repeatable, larger-scale automation — that's where Ansible's real strength is.
ELK data path
Logstash ingests log data from systems and apps → Elasticsearch stores and indexes it for fast search → Kibana queries Elasticsearch and renders dashboards (histograms, pie charts, trends).
Misapplied policy — the most common Ansible failure isn't a broken playbook — it's the target instance simply not being a member of the group the policy was applied to.
05

Source Control with Git

Four zones, six commands you'll actually use daily.

Common git subcommands

CommandDoes
initCreate a new repository
cloneCopy an existing remote repository locally
addStage files to be tracked
commitSnapshot staged changes into the local repo
pushUpload local commits to the remote repo
pullFetch and merge remote changes locally
branchCreate/manage pointers to snapshots
mergeIntegrate one branch's changes into another
rebaseRewrite history for a linear, cleaner log
checkoutSwitch the working directory to a branch
merge vs. rebase — merge preserves real history, including parallel work. Rebase rewrites history to look serial and linear — easier to read, but no longer literally what happened.

Security practices for automation code

  • Never hardcode passwords in scripts or playbooks
  • Use SSH key-based authentication so automation isn't interrupted by password prompts
  • Store secrets in a password vault (e.g., Ansible Vault), not in the repo
  • Give services their own individual accounts with least privilege
  • Default deny — no access unless explicitly granted
06

Bash Scripting

Consistency, speed, and accuracy — the same commands, run the same way, every single time.

# comments start with #, run before the script's real work
num_file=432
total_files=512
echo "There are $((total_files - num_file)) files remaining."
loops.sh

        

Operators

Bash testMeaningArithmetic/logicMeaning
-eqEqual to==Equal to
-neNot equal to!=Not equal to
-gtGreater than&&Logical AND
-ltLess than!Logical negation
Exit status — the test command returns 0 for true and 1 for false — the opposite of what many people instinctively expect from "0 = off."
07

Integration of Systems

Decoupled services talking to each other over HTTP, triggered by events rather than by polling.

Event-driven example: an order

  • Item added to cart → order placed → billing charges the card → shipping ships the order → purchaser notified

Each step is a discrete event triggering the next — the architecture stays agile, scales independently, and keeps microservices decoupled from each other.

API / protocolNotable trait
RESTArchitectural style; scalable, language- and platform-independent
SOAPXML-based, strong platform independence (Windows/macOS/Linux)
RPCCalls code execution in another address space
WebSocketsTwo-way, persistent client-server communication
GraphQLClient requests exactly the fields it needs — nothing extra
REST request flow — client sends request → server checks credentials → server processes the request → server responds with the requested data.

Exam Keyword Flashcards

Tap a card to flip it.

Quick Self-Check

Four questions pulled straight from the module.

Score: 0 / 0
Module 8 · Automating Cloud Resources CompTIA Cloud+ Objectives 2.4, 5.1–5.4