Verify a provisioned environment five ways
Task
An apply succeeding means the platform accepted the requests, not that the environment is correct. Build a verification suite that checks structure, policy, connectivity including the negative cases, function, and rebuild.
Steps
- Apply the environment from the 2.2 applied lab, or build a comparable one: network, identity, a service and a data store.
- Structural check: run plan again and assert it is empty. Save to
lab/verify/structure.txt. - Policy check: run a policy scan asserting encryption enabled, no public exposure, logging on, required tags present. Save the result, then deliberately break ONE of those and capture the failure too.
- Connectivity: assert at least three things that must connect and three that must NOT. Record both sets and their results in
lab/verify/connectivity.md. - Function and rebuild: smoke-test the service end to end through its real name, then destroy the environment, re-apply from code, and confirm every check above still passes. Record in
lab/verify/rebuild.txt.
Verify
for f in structure policy connectivity rebuild; do test -s lab/verify/$f.* && echo "$f ok"; done
grep -Eci 'must not|cannot|denied' lab/verify/connectivity.md
grep -Eci 'fail' lab/verify/policy.txt
grep -Eci 'pass|ok|success' lab/verify/rebuild.txt
All four artefacts, negative connectivity assertions present, and a recorded policy FAILURE. A policy suite that has only ever passed has not been shown to detect anything, which is the standing rule for every check in this course.
This is an independent study companion for CompTIA Cloud+ CV0-004 and is not produced by or endorsed by CompTIA.