AWS plan, cost and teardown review
Read a plan as a proposed change, not a guarantee
Before approving AWS changes, compare the account, region, state owner, source revision, provider lock and exact plan. A plan may create, update, replace or delete resources; an output may be unknown until apply. For a database, replacement can destroy data or cause downtime. Here is a deliberately simplified JSON excerpt for review, not a real saved plan or complete Terraform JSON schema.
{ "note": "Synthetic excerpt, not actual terraform show output", "resource_changes": [ { "address": "module.database.aws_db_instance.catalog", "change": { "actions": [ "delete", "create" ] } }, { "address": "module.application.aws_ecs_service.catalog", "change": { "actions": [ "update" ] } }, { "address": "module.edge.aws_lb.catalog", "change": { "actions": [ "no-op" ] } } ]}The database action sequence delete then create indicates replacement with deletion first. The ECS service has an in-place update proposal and the load balancer has no planned change. Stop and investigate the database replacement: check the reason and changed fields, backup and recovery plan, maintenance window, owner approval and possible address refactor if the change is only identity. A create-before-destroy replacement can still have service constraints and data migration risks.
Protect the reviewed artifact
Terraform can create a saved plan for later application. The following commands are reference material only; even planning against a real AWS provider can perform remote reads and initialization may install executable plugins. Never run these commands against the fictional files in this chapter.
# Reference only: approved cloud lab, not this offline chapter.terraform plan -out=review.tfplanterraform show review.tfplan# JSON may expose sensitive values; keep output in approved storage.terraform show -json review.tfplan# Only after fresh approval of this exact plan:terraform apply review.tfplanSaved plans and machine-readable output may contain secrets even when the terminal masks them. Limit storage and access, avoid public CI artifacts, and reject a plan that no longer corresponds to the approved state or configuration. A separate reviewer should check destructive actions, scope and identity. Terraform can fail after partial changes; it is not an all-or-nothing transaction. Inspect real state and reconcile after failure rather than retrying blindly.
Estimate cost from a resource inventory
Every architecture has a billing footprint. For a two-zone design, compare a zonal NAT gateway per zone against a shared path or endpoint approach. A shared zonal NAT can introduce cross-zone transfer and a failure dependency; regional NAT offerings or other egress designs must be evaluated using current service-specific docs. Endpoints also have distinct pricing: do not assume all endpoints are free. Public IPv4 addresses, load balancer usage, compute, database, storage, requests, logs and transfers need their own estimate. The following arithmetic uses invented prices, not AWS quotes.
Hypothetical rates only — USD, 30 days × 24 hours = 720 hours2 NAT gateways × 720 h × $0.05/h = $72.00120 GB NAT processing × $0.05/GB = $6.002 public IPv4 addresses × 720 h × $0.006/h = $8.6440 GB-month retained snapshots × $0.10/GB-month = $4.00Subtotal of these four items = $90.64The subtotal excludes ALB, ECS, RDS, S3, logs, taxes and other transfer charges. For a real estimate, obtain regional rates, usage units and applicable account terms from the pricing pages, and include peak and idle scenarios. Tagging helps attribute costs; alerts may lag and do not guarantee a hard spending cap. A reduced NAT count is not automatically cheaper or equally resilient.
Make retention an explicit design decision
A database must have an approved recovery objective and retention plan. AWS deletion protection can prevent a deletion until deliberately changed; Terraform prevent_destroy is a different configuration-level safeguard and is not sufficient if configuration is removed. Final snapshots and retained backups can support recovery, but they can continue to incur storage charges. Validate restoration, encryption-key access, owner and retention expiry before approving deletion. Likewise review S3 object versions, lifecycle rules, log groups and exported data. Do not enable forced deletion of valuable data as a cleanup convenience.
Teardown only the lab-owned resources
Start with an inventory linking each object to its owner and state. Disable traffic to the disposable application as approved, confirm no consumers remain, preserve required database and object data, then review a destroy plan for the exact lab state. Terraform uses dependency relationships for removal; external dependencies, deletion protection and provider failures may block it. Never delete unrelated shared networks, roles or buckets. After an approved teardown, independently check for remaining disks, snapshots, addresses, NAT gateways, logs, endpoints and charges. Record intentional retained resources, responsible owner and expiry. An empty Terraform state does not establish an empty AWS account or zero cost.
Practice reviewing changes and costs
Use the synthetic plan and cost worksheet in this chapter. Identify every replacement or deletion, explain whether the change is authorized, calculate the subtotal and propose a retention decision. Do not turn the fixture into an actual plan. The next chapter transfers the same provider-context reasoning to Azure, whose resource hierarchy and provider interfaces are different.
Check Your Understanding
Solidify your learning with the interactive assessment directly below this lesson.
Concept Quiz & Questions
AWS plan, cost and teardown review — knowledge check
Review private AWS architecture, cost and change safety.
A DB resource has actions delete then create. What is the correct review decision?
What is true of saved plans and JSON plan output?
Which subtotal matches the invented four-item cost model?
What can remain billable after deleting the database?
What does an empty Terraform state prove about AWS billing?