24 Retire safely and assess the complete lifecycle
A machine can be gone while its credentials, DNS records, scheduled clients, public addresses or paid disks remain. Conversely, a machine can still be needed by a consumer that the original operator forgot.
Type: retirement procedure and independent assessment. Prerequisites: complete inventory, owner approval, retention decisions and an accepted replacement or explicit service end. Outcome: end a server's authority without losing required data, access or financial control. Environment: owned local lab for automatic teardown; approved exact resources for real retirement. Evidence: final inventory comparison, revoked capabilities, stopped traffic, retained artifacts and billing/access checks.
Retirement begins before deletion
A machine can be gone while its credentials, DNS records, scheduled clients, public addresses or paid disks remain. Conversely, a machine can still be needed by a consumer that the original operator forgot. Retirement is therefore a dependency and authority change before it is a deletion operation.
Identify the service owner and decision reason. List users, clients, schedules, webhook senders, upstream/downstream services, datasets, credentials, keys, images, registries, monitoring, DNS, certificates, compute, storage, backups and paid subscriptions. Compare the list to discovered actual resources. Resolve unknown ownership before destructive changes. An inventory is useful only when it can find resources that outlive their application process.
Decide whether service is migrating or ending. For migration, verify replacement acceptance first and retain the old source according to the rollback plan. For ending, notify the authorized stakeholders through the organization's approved process and define the final intake date. A request to retire one service does not authorize deleting shared databases, shared identities or unrelated recovery points.
Drain, preserve and remove authority
Stop new submissions through the intended admission path. Let bounded accepted work finish or transfer it under a documented contract. Record jobs that cannot finish and their disposition. Stop schedules and webhook delivery deliberately so clients do not continue to accumulate failed work. Verify the stop from client observations rather than trusting only the control-plane command response.
Export data required by retention policy and verify it can be read or restored in the approved archive environment. Record format, schema, encryption, key custody, retention end, authorized readers and deletion owner. A private key retained with a retired machine image may preserve unintended access; a key deleted before archive verification may make required evidence unrecoverable.
Revoke the service's credentials, deployment identity, machine/user access, API keys, provider tokens and trust relationships that are dedicated to it. Verify a previously valid capability is denied without exposing its secret in evidence. Keep shared identities until the shared dependency is understood. Certificate revocation, expiration and private-key disposal depend on the certificate system and policy; record the actual chosen action.
Remove only confirmed owned resources
For each destructive action, identify the exact account, region, resource identifier, dependency and retention decision. Review the proposed removal list before executing. Prefer a scoped tool command with an exact resource list over broad pattern matching or “delete everything unused.” Name reuse and stale tags can make broad cleanup remove the wrong environment.
Remove traffic and service-discovery records deliberately. An obsolete DNS record pointing to a released address can later resolve to somebody else's resource. Confirm that monitoring no longer treats intentional retirement as an unresolved outage while retaining historical incident records. Remove or update runbooks and inventories so a future operator does not try to restart the retired service.
After removal, inspect the account for orphaned disks, addresses, gateways, backup schedules, registry retention, databases, monitoring resources and licenses. Check billing after the provider's reporting delay. An API deletion response is not itself evidence that every charge has ended. Preserve the retirement receipt with the last accepted inventory and responsible owner.
Learn safe automation from the local lab
The local lifecycle lab uses a private owned workspace and its own child processes. Its teardown must stop those processes, prove their listeners are gone and remove only that workspace. Neighbor files remain untouched. This is a deliberately narrower destructive scope than real cloud retirement, but it gives a testable safety contract for ownership and cleanup.
Run python3 ~/playground/labs/foundations.py from your VM workspace (~/playground) and inspect proof/lifecycle.json. Compare the stateless content service with the SQLite-backed key/value service. Find the steps that establish release identity, successful/denied requests, recovery and retirement. Identify where the receipt explicitly limits its claim to local process and storage behavior. The receipt is useful because it records what was observed, not because every stage has a reassuring name.
For a target-system retirement test, use a disposable approved environment with synthetic data. Create a resource inventory before deployment, then exercise the retirement procedure. Verify denied old credentials, closed intended listeners, accessible retained archive, no active schedules and no unexpected residual resources. Keep the resulting record separate from the local fixture receipt.
Independent capstone rubric
The capstone begins with a new brief rather than a copied sequence. Give the learner workload, user, security, availability, recovery and budget constraints. Require a completed requirements worksheet and architecture decision before provisioning. The learner must explain why the selected platform fits those constraints and what failure domains remain.
Assess five dimensions: correctness, security, operability, recoverability and explanation. Require observable outcomes in each. A working endpoint with exposed administrative credentials fails security. A secure endpoint without a restorable accepted record fails recovery. A restored record read from the original machine through a mistaken URL fails the intended separate-target proof.
A beginner passes the local CLI/API/worker lifecycle and can explain status codes, paths, secrets and process ownership. An intermediate operator provisions a controlled target, deploys the service, diagnoses a stopped worker and denied database credential, performs an update and validates backups. An advanced candidate demonstrates compatible migration, realistic load limits, recovery to a separate host, a failed release recovery and retirement inventory. Specialist competence requires the relevant target, such as a Enterprise Linux forest recovery or an actual GPU serving workload.
Use stop conditions. If the learner targets the wrong account, loses track of the authoritative dataset, exposes a secret or proposes destructive cleanup without exact ownership, stop the exercise and remediate that skill. Do not compensate for a critical access-control or data-loss failure by averaging it with good formatting scores. Repeat the failed scenario with new inputs after correction.
Keep a living tested system
Version the course and its examples together. Record tested OS/runtime/provider versions and dates. Re-run affected checks when dependencies, commands, identity behavior or deployment assumptions change. Preserve earlier editions so a reader can identify the material and evidence used for a historical release. Avoid replacing old receipts with newly generated files bearing the same success story but a different environment.
A complete production release contains usable procedures, assessments and explicit proof boundaries. Production acceptance belongs to each actual deployment. Expertise develops through repeated operation, failure diagnosis and review across the chosen domains. The framework helps you know what to investigate, implement and verify even when the next server differs from the last one.
Cleanup: archive the redacted course evidence and remove only approved disposable state. Pass: a second operator can reproduce the lifecycle, explain every acceptance boundary, recover the service under its agreed failure model and retire its resources without harming neighbors. Remaining work: every target-specific acceptance task stays visible in the gap register until it is actually demonstrated.