EC2 Instance Recovery Operator
What this skill does
Executes EC2 instance recovery operations correctly and safely. Runs
deterministic pre-checks before any state-changing CLI (instance
state, system/instance status checks, EBS attachment status, ASG
membership, SSM agent reachability, CloudWatch alarm config, Capacity
Reservation binding, placement group state, instance-store warning),
executes the recovery behind a CONFIRM gate, and verifies the result
by confirming the instance returns to running with both status
checks ok. Every recover-instance surfaces the failure-mode table so
the operator knows whether to stop/start, reboot, replace via ASG, or
escalate to AWS Support. Every forensic-ami captures the snapshot
BEFORE the instance is terminated or replaced.
Quick navigation
| Section |
What it covers |
When to read it |
| § Quick reference |
Verdict thresholds (BLOCKED/READY/COMPLETED) + pre-check priority |
Before any operation |
| § Mindset |
Why recovery is a state-preserve-then-restore sequence, the instance-store trap |
Understanding the safety model |
| § Pre-flight |
Instance metadata gate — state, status checks, ASG, Capacity Reservation |
Before executing any CLI |
| § Process |
Per-operation planning: recover-instance, stop-start, reboot, replace-via-asg, detach-attach-ebs, forensic-ami, enable-recovery-alarm, diagnose-impaired |
When choosing which operation to run |
| § Output format |
STRICT output contract — OPERATION/VERDICT/PRE_CHECKS/STEPS/POST_VERIFY/NOTES template |
Formatting the response |
| § Anti-Patterns |
NEVER list — common mistakes that lose data or extend downtime |
Review before risky operations |
| § Pre-flight safety |
Capture pre-state, AMI snapshot, EBS volume IDs, ASG suspend processes |
Defense-in-depth |
| § Expert heuristic |
Stop/start relocates to new hardware; reboot stays on the same host |
Choosing stop/start vs reboot |
STRICT output contract
EVERY response MUST end with a single fenced text block in this exact
shape (the operator's downstream tooling greps for it). No deviations:
OPERATION: <recover-instance | stop-start | reboot | replace-via-asg | detach-attach-ebs | forensic-ami | enable-recovery-alarm | diagnose-impaired>
VERDICT: READY | BLOCKED | COMPLETED
TARGET: <instance-id> (state: <state>, system-status: <status>, instance-status: <status>)
PRE_CHECKS:
- [PASS] <check description>
- [FAIL] <check description> — <reason>
STEPS:
1. <CLI command with flags populated, or "(none — pre-checks failed)">
2. <wait / monitoring command>
POST_VERIFY:
- [PASS] <verification description> | (pending execution)
- [FAIL] <verification description> — <reason>
NOTES: <data-preservation, monitoring, caveats>
Rules of the contract:
- VERDICT is exactly one of
READY, BLOCKED, COMPLETED. No other
values. READY means pre-checks passed and a CONFIRM gate is
pending; BLOCKED means at least one pre-check failed — do NOT
emit STEPS that mutate state; COMPLETED means post-verification
passed after the recovery action.
- If PRE_CHECKS has any
[FAIL], VERDICT MUST be BLOCKED and STEPS
MUST be (none — pre-checks failed).
- If VERDICT is
READY, STEPS[1] MUST be the CONFIRM prompt and
STEPS[2] MUST be the actual CLI.
- If VERDICT is
COMPLETED, POST_VERIFY MUST contain at least one
[PASS] and no [FAIL].
- Never wrap the block in JSON, never abbreviate the field names,
never omit a section. If a section is empty, write
(none).
Quick reference — verdict thresholds
| Verdict |
Trigger condition |
Action |
BLOCKED |
One or more pre-checks failed (instance in terminated state, instance-store volumes will be lost on stop/start, ASG will immediately replace before recovery completes, Capacity Reservation binding lost on stop, CloudWatch recovery alarm already configured and firing, SSM agent offline for session access) |
List failures, do NOT execute |
READY |
All pre-checks passed; awaiting CONFIRM gate |
Emit exact CLI sequence, wait for operator yes |
COMPLETED |
Recovery finished AND post-verification passed (instance running, both status checks ok, application healthy, EBS volumes reattached if detach/attach) |
Emit verification results, monitoring plan |
Priority order for pre-checks (apply in this sequence, all must
pass for READY):
- Instance reachability. Instance exists and is NOT in
terminated state. shutting-down waits; stopped requires
start only.
- Status check classification.
SystemStatus impaired →
hardware/host issue, recover via stop/start or CloudWatch recover.
InstanceStatus impaired → OS/application issue, recover via
reboot or SSM access.
- Instance-store warning. If
RootDeviceType: instance-store OR
any block device mapping has Ebs: No, stop/start and recover
LOSE ephemeral data. BLOCK unless the operator acknowledges.
- ASG membership. If the instance is in an ASG, stop/start may
trigger a health-check replacement. Suspend
HealthCheck /
AlarmNotification processes before stopping, or use the ASG's
managed replacement flow.
- EBS attachment. Capture all volume IDs and attachment state
before any recovery. If the instance is unreachable but EBS is
healthy, detach + attach to a recovery instance is the safest
data-salvage path.
- Capacity Reservation binding. If the instance has a Capacity
Reservation target, stop/start may release the binding. Use
describe-instance-attribute --attribute capacity-reservation-target,
and explicitly re-target on start.
- Placement group. Stop/start on a
cluster placement group
instance may fail to restart if the group lacks capacity. Consider
reboot (same host) for placement-group recovery.
- SSM agent reachability (for session access).
describe-instance- information shows PingStatus: Online for SSM-managed instances.
Offline SSM means Session Manager will not work; fall back to EC2
Serial Console or console output.
- CloudWatch recovery alarm. If a recovery alarm is already
configured and the instance is in
running after a recover action,
the alarm may have already fired — do NOT double-recover.
Cost/time baselines (2026):
- Stop/start: 2-5 minutes total (stop ~30s, start ~60s, boot varies).
- Reboot: 1-3 minutes (stays on same host, faster than stop/start).
- CloudWatch EC2 recover action: 1-5 minutes from alarm breach to
recover (same-host reboot, preserves EBS and instance store).
- ASG replacement: 3-10 minutes (launch + boot + health check + ELB).
- EBS detach/attach: 30-60 seconds per volume (same AZ only).
- AMI creation for forensic snapshot: 5-30 minutes depending on EBS
size (AMI + snapshots are async).
Mindset
One-line takeaway: Status: running is a process claim, not a
health claim. An instance is only "recovered" when both status checks
return ok AND the application responds to its health check. Driven
by three EC2 realities:
- Stop/start is destructive for instance-store volumes. Stop
releases the host; start lands on a different physical machine.
Any data on
instance-store volumes is gone. EBS-backed volumes
persist. Many operators learn this only after the first recovery.
- ASG-managed instances have their own recovery loop. When a
health check fails, the ASG marks the instance
Unhealthy and
launches a replacement. Stopping manually without suspending
HealthCheck causes the ASG to terminate it. Always check ASG
membership before manual recovery.
- The CloudWatch EC2 recover action is a same-host reboot, NOT a
stop/start. It preserves the host, EBS, and instance-store data,
but only fixes hardware issues detectable by the status check.
Pre-flight: instance metadata gate
Run before classification. Misclassifying these produces wrong plans.
Pagination: describe-instance-status paginates at 1,000
instances per call; drain --next-token for fleet-wide audits. For a
single instance, --instance-ids <id> returns one result.
Live-account pre-flight (skip if offline plan audit): the 7 read-only commands
(describe-instance-status ... get-console-output) are listed in Diagnostic commands.
Malformed-input protocol (VERDICT: ERROR + REMEDIATION): see Error handling.
| Instance attribute |
Effect on operation |
State: terminated |
BLOCKED. Route to EBS-based recovery (launch from snapshot/AMI). |
State: shutting-down |
Wait. Poll every 30s until stopped or terminated. |
SystemStatus: impaired |
Hardware/host. Stop/start relocates; recover reboots same host. |
InstanceStatus: impaired |
OS/app. Reboot or SSM session. Stop/start rarely helps. |
Events: instance-stop (scheduled) |
AWS will stop on scheduled date. Plan recovery before window. |
Events: system-reboot (scheduled) |
AWS will reboot. Do NOT manually reboot. |
RootDeviceType: instance-store |
Stop/start LOSES root volume. BLOCK unless acknowledged. |
ASG HealthStatus: Unhealthy |
ASG will terminate+replace. Suspend HealthCheck first. |
CapacityReservationId set |
Stop may release binding. Re-target on start. |
Placement.GroupName set (cluster) |
Stop/start may fail restart. Prefer reboot. |
Placement.Tenancy: host |
Stop releases dedicated host. Verify availability. |
| Existing recovery alarm |
Alarm may have fired. Check history; do NOT double-recover. |
Process — operation planning (apply in order)
Step 0: Expert knowledge - non-obvious EC2 recovery behaviors (condensed)
- Stop/start RELOCATES to a new host (loses instance-store data, releases Capacity Reservation/dedicated host). Reboot STAYS on the same host.
- CloudWatch EC2 recover action = API-driven same-host reboot; only helps
StatusCheckFailed_System.
- ASG-managed replacement usually beats manual recovery; suspend
HealthCheck if manual recovery is required.
- EBS detach/attach to a rescue instance in the same AZ is the safest data-salvage path.
create-image --no-reboot for forensic snapshots of hung instances; get-console-output shows the LAST boot only.
- Full deep dives (Serial Console, automatic recovery, placement groups, metric separation): Advanced patterns.
Step 1: Pre-check gate — BLOCKED if any check fails
Run ALL pre-checks for the chosen operation. If ANY fails, the verdict
is BLOCKED with the failed checks in PRE_CHECKS. Do NOT execute.
For ALL operations:
- Instance exists and is NOT
terminated.
- If
State: shutting-down, BLOCK (wait for transition).
- Capture all EBS volume IDs (for rollback).
- Capture
RootDeviceType (instance-store warning).
- Capture ASG membership (suspend processes if applicable).
For recover-instance (CloudWatch recover action):
6. SystemStatus: impaired (recover only helps hardware).
7. No existing recovery alarm already firing (check alarm history).
8. No scheduled instance-stop event pending (let AWS handle it).
For stop-start (relocate to new host):
6. RootDeviceType: ebs (instance-store loses data).
7. No instance-store block devices (or operator acknowledged).
8. ASG HealthCheck suspended (if applicable).
9. Capacity Reservation target captured for re-binding.
10. Placement group has free capacity for restart (cluster groups).
For reboot (same host):
6. No pending system-reboot scheduled event (let AWS handle it).
7. Instance is running (reboot on stopped is a no-op).
For replace-via-asg:
6. Instance is in an ASG.
7. ASG HealthCheck process is Resumed (not suspended).
8. ASG MinSize >= 1 (so the replacement launches).
9. ELB/target group health check configured (so the new instance
registers).
For detach-attach-ebs (data salvage):
6. Rescue instance exists in the same AZ.
7. EBS volume is in-use (attached to the unhealthy instance).
8. DeleteOnTermination: false for the volume (otherwise the source
instance's termination deletes it).
9. Rescue instance has the volume slot free (no name conflict on the
device name).
For forensic-ami (snapshot before termination):
6. Instance is NOT terminated (AMI cannot capture a terminated
instance).
7. EBS-backed root volume (instance-store root cannot be snapshotted).
8. AMI name does not collide with an existing AMI.
For enable-recovery-alarm:
6. No existing recovery alarm on the same metric (avoid duplicate
actions).
7. InstanceType supports the EC2 recover action (all current-gen
types; some previous-gen types do not).
8. InstanceStatus: ok (do not set a recovery alarm during a known
OS issue — the alarm fires on StatusCheckFailed_System only,
but verify the operator understands this).
For diagnose-impaired (read-only, no BLOCKED gate):
6. Read the failure-mode table and console output to identify the
root cause.
Failure-mode table (use during diagnose-impaired):
| Symptom |
Root cause |
Fix |
SystemStatus: impaired, InstanceStatus: ok |
Host hardware degradation |
Stop/start OR CloudWatch recover |
InstanceStatus: impaired, SystemStatus: ok |
OS / filesystem / kernel hang |
Reboot; if unreachable, SSM or Serial Console |
Both impaired |
Network / VPC / ENI reachability loss |
Check route table, ENI; stop/start if ENI re-attach needed |
State: running, no SSH, SSM Online |
Security group / IAM role issue |
SSM Session Manager; verify SG ingress + SSM role |
State: running, no SSH, SSM ConnectionLost |
SSM agent hung or OS network down |
Reboot; if persistent, EBS detach/attach for repair |
| Console: kernel panic |
Kernel module or boot config |
Stop/start; if persistent, EBS detach/attach to revert module |
Console: No space left on device |
Disk full |
SSM session to clean up; or expand EBS volume |
Console: Failed to mount root filesystem |
Corrupted root EBS |
Detach root, attach to rescue, fsck, reattach |
| ASG churn (rapid launch/terminate) |
Launch config / AMI / health check |
Diagnose via ASG activity; freeze ASG to stop churn |
State: stopped immediately after launch |
User-data script failure |
Check console output; fix user-data; restart |
Step 2: READY — emit operation plan
If all pre-checks pass, emit VERDICT: READY with the exact CLI
sequence and the CONFIRM gate. The plan includes:
- The exact AWS CLI command with all flags populated from the
instance metadata.
- The expected duration (stop/start 2-5 min; reboot 1-3 min; AMI
5-30 min depending on EBS size).
- The expected side-effects (instance-store data lost on stop/start;
Capacity Reservation binding released; ASG health-check paused).
- The CONFIRM gate prompt.
- The monitoring commands (poll
describe-instance-status, check
application health endpoint).
Step 3: Execute behind CONFIRM gate
- MANDATORY CONFIRMATION GATE. Before
stop-instances,
start-instances, reboot-instances, detach-volume,
attach-volume, create-image, terminate-instances,
cloudwatch put-metric-alarm, autoscaling suspend-processes /
resume-processes, emit: CONFIRM: About to <operation> on <instance-id> in account <account> region <region>. This will <consequence>. Proceed? (yes/no). Do NOT execute until the
operator confirms.
- Capture pre-state:
aws ec2 describe-instances --instance-ids <id> --output json > /tmp/<id>-pre-$(date +%s).json AND aws ec2 describe-volumes --filters Name=attachment.instance-id,Values=<id> --output json > /tmp/<id>-volumes-$(date +%s).json.
- For forensic-ami: ALWAYS run AMI creation BEFORE any stop/start or
terminate. The AMI is the point-in-time snapshot.
- For stop/start: poll
describe-instance-status every 30 seconds
until State: running and both status checks return ok.
Step 4: Post-verification — COMPLETED
After the recovery finishes, run post-verification. ALL checks must
pass for COMPLETED.
describe-instance-status --instance-ids <id> — confirm
State: running, SystemStatus.Status: ok,
InstanceStatus.Status: ok.
- No scheduled
Events pending (or, if scheduled, surface them).
- For stop-start: confirm EBS volumes reattached and
DeleteOn- Termination preserved.
- For stop-start with Capacity Reservation: confirm binding re-
established (
describe-instances --query Reservations[0].Instances [0].CapacityReservationId).
- For ASG replacement: confirm the new instance is
InService and
passes the ELB / target group health check.
- For EBS detach/attach: confirm the volume is
in-use on the
target instance at the expected device name.
- For forensic-ami: confirm the AMI is
available and all snapshots
are completed.
- Application health: hit the instance's health-check endpoint or
CloudWatch metric; confirm the workload recovered.
If ANY verification fails, emit VERDICT: ERROR with the failure
details — do not claim COMPLETED.
Output format (per operation)
See § STRICT output contract above. The block MUST appear exactly in
that shape at the end of the response.
Worked example — recover-instance (stop/start)
OPERATION: stop-start
VERDICT: READY
TARGET: i-0abcdef1234567890 (state: running, system-status: impaired,
instance-status: ok)
PRE_CHECKS:
- [PASS] Instance exists, not terminated
- [PASS] SystemStatus impaired (host issue), InstanceStatus ok
- [PASS] RootDeviceType: ebs (no data loss on stop)
- [PASS] No instance-store block devices
- [PASS] ASG: not a member (no suspend needed)
- [PASS] Capacity Reservation: not bound
- [PASS] Placement: default (no cluster constraint)
STEPS:
1. CONFIRM: About to stop and start i-0abcdef1234567890 in account
111111111111 region us-east-1. This will RELOCATE to a new host
(clears hardware impairment), cause 2-5 min downtime, preserve
EBS. Proceed? (yes/no)
2. aws ec2 stop-instances --instance-ids i-0abcdef1234567890
3. Poll describe-instance-status every 30s until stopped
4. aws ec2 start-instances --instance-ids i-0abcdef1234567890
5. Poll describe-instance-status every 30s until running + ok
POST_VERIFY:
- (pending execution)
NOTES:
- Stop/start is correct for SystemStatus impaired. Reboot would
keep the instance on the same impaired host.
- Set up a CloudWatch recovery alarm for auto-recovery:
aws cloudwatch put-metric-alarm --alarm-name recover-i-0abcdef
--metric-name StatusCheckFailed_System --namespace AWS/EC2
--dimensions Name=InstanceId,Value=i-0abcdef1234567890
--threshold 1 --comparison-operator GreaterThanOrEqualToThreshold
--period 60 --evaluation-periods 2
--alarm-actions arn:aws:automate:us-east-1:ec2:recover
Anti-Patterns — NEVER
NEVER stop an instance with RootDeviceType: instance-store
without explicitly warning that the root volume and all instance-
store volumes will be LOST. Stop releases the host; no recovery
path for ephemeral data.
NEVER manually stop an ASG-managed instance without first
suspending HealthCheck. The ASG detects the stop, marks it
Unhealthy, and terminates it — destroying in-flight work.
NEVER use the EC2 recover action for InstanceStatus: impaired.
Recover only addresses SystemStatus (hardware). For OS issues,
recover does nothing and the alarm keeps firing.
NEVER reboot an instance with a pending system-reboot scheduled
event. The scheduled event runs automatically; a manual reboot
masks the hardware issue and prevents AWS from applying the fix.
NEVER create a forensic AMI AFTER stopping or terminating the
instance. AMI creation captures the running state. Stop clears
in-memory state; terminate destroys the instance. AMI FIRST.
NEVER detach the root volume of a running instance without
stopping it (use --force only if the instance is hung and stop
is not completing). Forced detach can corrupt the filesystem.
NEVER assume State: running means the application is healthy.
Verify the application's health check, not just EC2 status
checks. A hung process keeps the instance running while idle.
NEVER forget to re-bind the Capacity Reservation on start. Stop
releases the binding; start without --capacity-reservation- specification loses the reservation.
NEVER rely on get-console-output for historical diagnosis after
a reboot. Each boot clears the prior log. Capture to a local
file BEFORE any recovery action.
NEVER use create-image --no-reboot for production AMIs. It
captures the filesystem in a potentially inconsistent state. Use
ONLY for forensic snapshots of hung instances.
NEVER double-recover. If a CloudWatch recovery alarm already fired,
check alarm history before triggering another recovery. Double-
recovery extends downtime without fixing anything.
NEVER terminate an instance to "force recovery" without first
detaching EBS volumes and capturing an AMI. Termination is
irreversible.
NEVER auto-execute a state-changing EC2 recovery CLI without the
CONFIRM gate. Stop, reboot, detach, terminate, and AMI creation
all extend downtime or destroy data.
Pre-flight safety checks (run before any remediation CLI)
MANDATORY CONFIRMATION GATE. Before any state-changing
operation, emit the CONFIRM prompt. Do NOT execute until the
operator confirms.
Full defense-in-depth checklist (pre-state capture commands, AMI-first, ASG suspension, Capacity Reservation re-targeting, placement-group capacity): Advanced patterns.
Expert heuristic: stop/start vs. reboot
The single highest-leverage decision in EC2 recovery is:
Stop/start relocates the instance to a new physical host. Reboot
stays on the same host. Match the operation to the impairment:
SystemStatus: impaired → stop/start (host is bad). InstanceStatus: impaired → reboot or SSM access (host is fine, OS is not). Never
use reboot for a hardware impairment — the instance stays on the
broken host and the impairment persists.
Why this matters: Operators frequently confuse reboot with
stop/start. Both appear to "restart" the instance, but they have
opposite effects on the physical host. A reboot on an impaired host
extends the outage. A stop/start on an OS issue adds 2-5 minutes of
downtime without fixing anything.
Decision matrix:
| Symptom |
Operation |
Why |
SystemStatus: impaired, InstanceStatus: ok |
Stop/start OR CloudWatch recover |
Host hardware bad |
InstanceStatus: impaired, SystemStatus: ok |
Reboot OR SSM session |
OS hung |
Both impaired |
Diagnose first (console, ENI) |
Could be network/ENI |
State: running, no SSH/SSM |
EBS detach/attach for filesystem repair |
OS unreachable |
| ASG-managed, health checks failing |
ASG-managed replacement |
ASG is the recovery loop |
Pending system-reboot event |
Wait for AWS |
Manual reboot masks the issue |
Pending instance-stop event |
Stop/start BEFORE the window |
Proactively relocate |
Surface in the output: for any recovery, include
HOST_CHANGE: <yes | no> and DATA_LOSS_RISK: <yes | no>. If
DATA_LOSS_RISK: yes and the operator has not acknowledged, BLOCK.
Verification protocol (apply on every recovery):
- Status check restoration:
describe-instance-status — both
SystemStatus and InstanceStatus return ok.
- Application health: hit the workload's health endpoint. EC2
status checks do not verify the application.
- EBS integrity:
describe-volumes — all volumes in-use.
- Capacity Reservation: confirm the binding (if applicable).
- Console output: capture post-recovery console log.
References (load on demand)
- Worked examples - detach-attach-ebs (COMPLETED) and diagnose-impaired (BLOCKED) walkthroughs
- Error handling - malformed-input VERDICT: ERROR protocol
- Diagnostic commands - live-account pre-flight command listing
- Advanced patterns - expert behaviors, defense-in-depth safety checklist, 2024-2026 features
- Status check deep dive - System vs Instance status, stop/start vs reboot attribute tables
- Recovery procedures - per-archetype diagnostic and recovery procedures
Domain
AWS CloudOps / EC2 Instance Recovery, Compute Resilience, and
Forensic Preservation.
AWS documentation
1---2name: ec2-instance-recovery-operator3description: Operates EC2 instance recovery — system status check failure (hardware degradation, stop/start, EC2 recover action), CloudWatch alarm recovery (reboots on same host), instance replacement via Auto Scaling group health check, EBS volume detach/attach for data salvage, console output for OS-level diagnosis, SSM Session Manager for SSH-less live troubleshooting, AMI creation from a failing instance for forensic snapshot, instance stop/start to clear ephemeral issues, placement group recovery, EC2 automatic recovery, and Capacity Reservation preservation during recovery. Runs deterministic pre-checks (instance state, system status check, EBS attachment status, ASG membership, SSM agent reachability, CloudWatch alarm config, Capacity Reservation binding) behind a CONFIRM gate and emits a READY, BLOCKED, or COMPLETED verdict per recovery action. Use when an instance is impaired, hardware has degraded, an ASG is churning, or a forensic snapshot is needed before termination.4license: Apache-2.05compatibility: Agent runtime that reads SKILL.md (Claude Code, Cursor, Windsurf, Codex, Gemini). No AWS CLI required for offline plan classification. Live-account operations use aws ec2 describe-instance-status, describe-instances, stop-instances, start-instances, reboot-instances, describe-volumes, detach-volume, attach-volume, get-console-output, create-image, describe-instance-attribute, aws ssm start-session, describe-instance-information, aws cloudwatch describe-alarms, put-metric-alarm, and...6metadata:7 source: https://skillmd.com/skills/jhkchan/ec2-instance-recovery-operator8 domain: aws-cloudops9 complexity: high10 requires_llm: 'true'11 phase: '4'12 supports_pipeline: 'true'13 entry_point: 'false'14 family: Compute15 task_type: operate16 skill_class: capability17 lifecycle_status: active18 verdict_shape: READY | BLOCKED | COMPLETED19 when_to_use: Recovering from an EC2 system status check failure (hardware degradation), configuring CloudWatch alarm recovery, replacing an instance via Auto Scaling group health check, detaching and reattaching EBS volumes to salvage data from an unhealthy instance, diagnosing OS-level issues via console output, accessing an impaired instance via SSM Session Manager, creating an AMI for forensic snapshot before termination, stop/starting an instance to clear ephemeral issues, recovering an instance in a placement group, or preserving a Capacity Reservation binding during recovery.20 activation_triggers: instance status check failed, system status check failed, instance impaired, hardware degradation, EC2 recover, CloudWatch recovery alarm, instance stop start, reboot instance, ASG instance replacement, Auto Scaling health check, EBS detach attach, console output, Session Manager access, AMI forensic snapshot, placement group recovery, Capacity Reservation, instance unreachable, EC2 automatic recovery21 invocation_schema: 'Input: either (a) an instance configuration (describe-instance-status, describe-instances) plus the intended operation (recover-instance, stop-start, reboot, replace-via-asg, detach-attach-ebs, forensic-ami, enable-recovery-alarm, diagnose-impaired), OR (b) an instance-id + operation for live-account execution. Output: deterministic OPERATION / VERDICT / PRE_CHECKS / STEPS / POST_VERIFY / NOTES block per recovery, where VERDICT is one of READY, BLOCKED, COMPLETED.'22 version: 0.1.023 author: Jacky Chan — AWS Community Builder24 keywords: EC2 instance recovery, system status check, instance status check, hardware degradation, stop/start instance, EC2 recover action, CloudWatch alarm recovery, Auto Scaling group replacement, ASG health check, EBS detach attach, console output, get-console-output, SSM Session Manager, AMI forensic snapshot, placement group recovery, Capacity Reservation, instance store, ephemeral storage, impaired instance, EC2 automatic recovery25 tags: aws, ec2, compute, recovery, ebs, ssm, cloudwatch, autoscaling, forensics, operate26---2728# EC2 Instance Recovery Operator2930## What this skill does3132Executes EC2 instance recovery operations correctly and safely. Runs33deterministic pre-checks before any state-changing CLI (instance34state, system/instance status checks, EBS attachment status, ASG35membership, SSM agent reachability, CloudWatch alarm config, Capacity36Reservation binding, placement group state, instance-store warning),37executes the recovery behind a CONFIRM gate, and verifies the result38by confirming the instance returns to `running` with both status39checks `ok`. Every recover-instance surfaces the failure-mode table so40the operator knows whether to stop/start, reboot, replace via ASG, or41escalate to AWS Support. Every forensic-ami captures the snapshot42BEFORE the instance is terminated or replaced.4344## Quick navigation4546| Section | What it covers | When to read it |47|---|---|---|48| **§ Quick reference** | Verdict thresholds (BLOCKED/READY/COMPLETED) + pre-check priority | Before any operation |49| **§ Mindset** | Why recovery is a state-preserve-then-restore sequence, the instance-store trap | Understanding the safety model |50| **§ Pre-flight** | Instance metadata gate — state, status checks, ASG, Capacity Reservation | Before executing any CLI |51| **§ Process** | Per-operation planning: recover-instance, stop-start, reboot, replace-via-asg, detach-attach-ebs, forensic-ami, enable-recovery-alarm, diagnose-impaired | When choosing which operation to run |52| **§ Output format** | STRICT output contract — OPERATION/VERDICT/PRE_CHECKS/STEPS/POST_VERIFY/NOTES template | Formatting the response |53| **§ Anti-Patterns** | NEVER list — common mistakes that lose data or extend downtime | Review before risky operations |54| **§ Pre-flight safety** | Capture pre-state, AMI snapshot, EBS volume IDs, ASG suspend processes | Defense-in-depth |55| **§ Expert heuristic** | Stop/start relocates to new hardware; reboot stays on the same host | Choosing stop/start vs reboot |5657## STRICT output contract5859EVERY response MUST end with a single fenced text block in this exact60shape (the operator's downstream tooling greps for it). No deviations:6162```text63OPERATION: <recover-instance | stop-start | reboot | replace-via-asg | detach-attach-ebs | forensic-ami | enable-recovery-alarm | diagnose-impaired>64VERDICT: READY | BLOCKED | COMPLETED65TARGET: <instance-id> (state: <state>, system-status: <status>, instance-status: <status>)66PRE_CHECKS:67 - [PASS] <check description>68 - [FAIL] <check description> — <reason>69STEPS:70 1. <CLI command with flags populated, or "(none — pre-checks failed)">71 2. <wait / monitoring command>72POST_VERIFY:73 - [PASS] <verification description> | (pending execution)74 - [FAIL] <verification description> — <reason>75NOTES: <data-preservation, monitoring, caveats>76```7778Rules of the contract:7980- VERDICT is exactly one of `READY`, `BLOCKED`, `COMPLETED`. No other81 values. `READY` means pre-checks passed and a CONFIRM gate is82 pending; `BLOCKED` means at least one pre-check failed — do NOT83 emit STEPS that mutate state; `COMPLETED` means post-verification84 passed after the recovery action.85- If PRE_CHECKS has any `[FAIL]`, VERDICT MUST be `BLOCKED` and STEPS86 MUST be `(none — pre-checks failed)`.87- If VERDICT is `READY`, STEPS[1] MUST be the CONFIRM prompt and88 STEPS[2] MUST be the actual CLI.89- If VERDICT is `COMPLETED`, POST_VERIFY MUST contain at least one90 `[PASS]` and no `[FAIL]`.91- Never wrap the block in JSON, never abbreviate the field names,92 never omit a section. If a section is empty, write `(none)`.9394## Quick reference — verdict thresholds9596| Verdict | Trigger condition | Action |97|---|---|---|98| `BLOCKED` | One or more pre-checks failed (instance in `terminated` state, instance-store volumes will be lost on stop/start, ASG will immediately replace before recovery completes, Capacity Reservation binding lost on stop, CloudWatch recovery alarm already configured and firing, SSM agent offline for session access) | List failures, do NOT execute |99| `READY` | All pre-checks passed; awaiting CONFIRM gate | Emit exact CLI sequence, wait for operator yes |100| `COMPLETED` | Recovery finished AND post-verification passed (instance `running`, both status checks `ok`, application healthy, EBS volumes reattached if detach/attach) | Emit verification results, monitoring plan |101102**Priority order for pre-checks (apply in this sequence, all must103pass for READY):**1041051. **Instance reachability.** Instance exists and is NOT in106 `terminated` state. `shutting-down` waits; `stopped` requires107 start only.1082. **Status check classification.** `SystemStatus` impaired →109 hardware/host issue, recover via stop/start or CloudWatch recover.110 `InstanceStatus` impaired → OS/application issue, recover via111 reboot or SSM access.1123. **Instance-store warning.** If `RootDeviceType: instance-store` OR113 any block device mapping has `Ebs: No`, stop/start and recover114 LOSE ephemeral data. BLOCK unless the operator acknowledges.1154. **ASG membership.** If the instance is in an ASG, stop/start may116 trigger a health-check replacement. Suspend `HealthCheck` /117 `AlarmNotification` processes before stopping, or use the ASG's118 managed replacement flow.1195. **EBS attachment.** Capture all volume IDs and attachment state120 before any recovery. If the instance is unreachable but EBS is121 healthy, detach + attach to a recovery instance is the safest122 data-salvage path.1236. **Capacity Reservation binding.** If the instance has a Capacity124 Reservation target, stop/start may release the binding. Use125 `describe-instance-attribute --attribute capacity-reservation-target`,126 and explicitly re-target on start.1277. **Placement group.** Stop/start on a `cluster` placement group128 instance may fail to restart if the group lacks capacity. Consider129 reboot (same host) for placement-group recovery.1308. **SSM agent reachability (for session access).** `describe-instance-131 information` shows `PingStatus: Online` for SSM-managed instances.132 Offline SSM means Session Manager will not work; fall back to EC2133 Serial Console or console output.1349. **CloudWatch recovery alarm.** If a recovery alarm is already135 configured and the instance is in `running` after a recover action,136 the alarm may have already fired — do NOT double-recover.137138**Cost/time baselines (2026):**139140- Stop/start: 2-5 minutes total (stop ~30s, start ~60s, boot varies).141- Reboot: 1-3 minutes (stays on same host, faster than stop/start).142- CloudWatch EC2 recover action: 1-5 minutes from alarm breach to143 recover (same-host reboot, preserves EBS and instance store).144- ASG replacement: 3-10 minutes (launch + boot + health check + ELB).145- EBS detach/attach: 30-60 seconds per volume (same AZ only).146- AMI creation for forensic snapshot: 5-30 minutes depending on EBS147 size (AMI + snapshots are async).148149## Mindset150151**One-line takeaway:** `Status: running` is a process claim, not a152health claim. An instance is only "recovered" when both status checks153return `ok` AND the application responds to its health check. Driven154by three EC2 realities:155156- **Stop/start is destructive for instance-store volumes.** Stop157 releases the host; start lands on a different physical machine.158 Any data on `instance-store` volumes is gone. EBS-backed volumes159 persist. Many operators learn this only after the first recovery.160- **ASG-managed instances have their own recovery loop.** When a161 health check fails, the ASG marks the instance `Unhealthy` and162 launches a replacement. Stopping manually without suspending163 `HealthCheck` causes the ASG to terminate it. Always check ASG164 membership before manual recovery.165- **The CloudWatch EC2 recover action is a same-host reboot, NOT a166 stop/start.** It preserves the host, EBS, and instance-store data,167 but only fixes hardware issues detectable by the status check.168169## Pre-flight: instance metadata gate170171Run before classification. Misclassifying these produces wrong plans.172173**Pagination:** `describe-instance-status` paginates at 1,000174instances per call; drain `--next-token` for fleet-wide audits. For a175single instance, `--instance-ids <id>` returns one result.176177**Live-account pre-flight (skip if offline plan audit):** the 7 read-only commands178(describe-instance-status ... get-console-output) are listed in [Diagnostic commands](references/diagnostic-commands.md).179180Malformed-input protocol (VERDICT: ERROR + REMEDIATION): see [Error handling](references/error-handling.md).181182| Instance attribute | Effect on operation |183|---|---|184| `State: terminated` | BLOCKED. Route to EBS-based recovery (launch from snapshot/AMI). |185| `State: shutting-down` | Wait. Poll every 30s until `stopped` or `terminated`. |186| `SystemStatus: impaired` | Hardware/host. Stop/start relocates; recover reboots same host. |187| `InstanceStatus: impaired` | OS/app. Reboot or SSM session. Stop/start rarely helps. |188| `Events: instance-stop` (scheduled) | AWS will stop on scheduled date. Plan recovery before window. |189| `Events: system-reboot` (scheduled) | AWS will reboot. Do NOT manually reboot. |190| `RootDeviceType: instance-store` | Stop/start LOSES root volume. BLOCK unless acknowledged. |191| ASG `HealthStatus: Unhealthy` | ASG will terminate+replace. Suspend `HealthCheck` first. |192| `CapacityReservationId` set | Stop may release binding. Re-target on start. |193| `Placement.GroupName` set (cluster) | Stop/start may fail restart. Prefer reboot. |194| `Placement.Tenancy: host` | Stop releases dedicated host. Verify availability. |195| Existing recovery alarm | Alarm may have fired. Check history; do NOT double-recover. |196197## Process — operation planning (apply in order)198199### Step 0: Expert knowledge - non-obvious EC2 recovery behaviors (condensed)200201- Stop/start RELOCATES to a new host (loses instance-store data, releases Capacity Reservation/dedicated host). Reboot STAYS on the same host.202- CloudWatch EC2 recover action = API-driven same-host reboot; only helps `StatusCheckFailed_System`.203- ASG-managed replacement usually beats manual recovery; suspend `HealthCheck` if manual recovery is required.204- EBS detach/attach to a rescue instance in the same AZ is the safest data-salvage path.205- `create-image --no-reboot` for forensic snapshots of hung instances; `get-console-output` shows the LAST boot only.206- Full deep dives (Serial Console, automatic recovery, placement groups, metric separation): [Advanced patterns](references/advanced-patterns.md).207208### Step 1: Pre-check gate — BLOCKED if any check fails209210Run ALL pre-checks for the chosen operation. If ANY fails, the verdict211is BLOCKED with the failed checks in PRE_CHECKS. Do NOT execute.212213**For ALL operations:**2141. Instance exists and is NOT `terminated`.2152. If `State: shutting-down`, BLOCK (wait for transition).2163. Capture all EBS volume IDs (for rollback).2174. Capture `RootDeviceType` (instance-store warning).2185. Capture ASG membership (suspend processes if applicable).219220**For recover-instance (CloudWatch recover action):**2216. `SystemStatus: impaired` (recover only helps hardware).2227. No existing recovery alarm already firing (check alarm history).2238. No scheduled `instance-stop` event pending (let AWS handle it).224225**For stop-start (relocate to new host):**2266. `RootDeviceType: ebs` (instance-store loses data).2277. No `instance-store` block devices (or operator acknowledged).2288. ASG `HealthCheck` suspended (if applicable).2299. Capacity Reservation target captured for re-binding.23010. Placement group has free capacity for restart (cluster groups).231232**For reboot (same host):**2336. No pending `system-reboot` scheduled event (let AWS handle it).2347. Instance is `running` (reboot on `stopped` is a no-op).235236**For replace-via-asg:**2376. Instance is in an ASG.2387. ASG `HealthCheck` process is `Resumed` (not suspended).2398. ASG `MinSize` >= 1 (so the replacement launches).2409. ELB/target group health check configured (so the new instance241 registers).242243**For detach-attach-ebs (data salvage):**2446. Rescue instance exists in the same AZ.2457. EBS volume is `in-use` (attached to the unhealthy instance).2468. `DeleteOnTermination: false` for the volume (otherwise the source247 instance's termination deletes it).2489. Rescue instance has the volume slot free (no name conflict on the249 device name).250251**For forensic-ami (snapshot before termination):**2526. Instance is NOT `terminated` (AMI cannot capture a terminated253 instance).2547. EBS-backed root volume (instance-store root cannot be snapshotted).2558. AMI name does not collide with an existing AMI.256257**For enable-recovery-alarm:**2586. No existing recovery alarm on the same metric (avoid duplicate259 actions).2607. `InstanceType` supports the EC2 recover action (all current-gen261 types; some previous-gen types do not).2628. `InstanceStatus: ok` (do not set a recovery alarm during a known263 OS issue — the alarm fires on `StatusCheckFailed_System` only,264 but verify the operator understands this).265266**For diagnose-impaired (read-only, no BLOCKED gate):**2676. Read the failure-mode table and console output to identify the268 root cause.269270**Failure-mode table (use during diagnose-impaired):**271272| Symptom | Root cause | Fix |273|---|---|---|274| `SystemStatus: impaired`, `InstanceStatus: ok` | Host hardware degradation | Stop/start OR CloudWatch recover |275| `InstanceStatus: impaired`, `SystemStatus: ok` | OS / filesystem / kernel hang | Reboot; if unreachable, SSM or Serial Console |276| Both `impaired` | Network / VPC / ENI reachability loss | Check route table, ENI; stop/start if ENI re-attach needed |277| `State: running`, no SSH, SSM `Online` | Security group / IAM role issue | SSM Session Manager; verify SG ingress + SSM role |278| `State: running`, no SSH, SSM `ConnectionLost` | SSM agent hung or OS network down | Reboot; if persistent, EBS detach/attach for repair |279| Console: kernel panic | Kernel module or boot config | Stop/start; if persistent, EBS detach/attach to revert module |280| Console: `No space left on device` | Disk full | SSM session to clean up; or expand EBS volume |281| Console: `Failed to mount root filesystem` | Corrupted root EBS | Detach root, attach to rescue, `fsck`, reattach |282| ASG churn (rapid launch/terminate) | Launch config / AMI / health check | Diagnose via ASG activity; freeze ASG to stop churn |283| `State: stopped` immediately after launch | User-data script failure | Check console output; fix user-data; restart |284285### Step 2: READY — emit operation plan286287If all pre-checks pass, emit `VERDICT: READY` with the exact CLI288sequence and the CONFIRM gate. The plan includes:289290- The exact AWS CLI command with all flags populated from the291 instance metadata.292- The expected duration (stop/start 2-5 min; reboot 1-3 min; AMI293 5-30 min depending on EBS size).294- The expected side-effects (instance-store data lost on stop/start;295 Capacity Reservation binding released; ASG health-check paused).296- The CONFIRM gate prompt.297- The monitoring commands (poll `describe-instance-status`, check298 application health endpoint).299300### Step 3: Execute behind CONFIRM gate301302- **MANDATORY CONFIRMATION GATE.** Before `stop-instances`,303 `start-instances`, `reboot-instances`, `detach-volume`,304 `attach-volume`, `create-image`, `terminate-instances`,305 `cloudwatch put-metric-alarm`, `autoscaling suspend-processes` /306 `resume-processes`, emit: `CONFIRM: About to <operation> on307 <instance-id> in account <account> region <region>. This will308 <consequence>. Proceed? (yes/no)`. Do NOT execute until the309 operator confirms.310- Capture pre-state: `aws ec2 describe-instances --instance-ids <id>311 --output json > /tmp/<id>-pre-$(date +%s).json` AND `aws ec2312 describe-volumes --filters Name=attachment.instance-id,Values=<id>313 --output json > /tmp/<id>-volumes-$(date +%s).json`.314- For forensic-ami: ALWAYS run AMI creation BEFORE any stop/start or315 terminate. The AMI is the point-in-time snapshot.316- For stop/start: poll `describe-instance-status` every 30 seconds317 until `State: running` and both status checks return `ok`.318319### Step 4: Post-verification — COMPLETED320321After the recovery finishes, run post-verification. ALL checks must322pass for `COMPLETED`.3233241. `describe-instance-status --instance-ids <id>` — confirm325 `State: running`, `SystemStatus.Status: ok`,326 `InstanceStatus.Status: ok`.3272. No scheduled `Events` pending (or, if scheduled, surface them).3283. For stop-start: confirm EBS volumes reattached and `DeleteOn-329 Termination` preserved.3304. For stop-start with Capacity Reservation: confirm binding re-331 established (`describe-instances --query Reservations[0].Instances332 [0].CapacityReservationId`).3335. For ASG replacement: confirm the new instance is `InService` and334 passes the ELB / target group health check.3356. For EBS detach/attach: confirm the volume is `in-use` on the336 target instance at the expected device name.3377. For forensic-ami: confirm the AMI is `available` and all snapshots338 are `completed`.3398. Application health: hit the instance's health-check endpoint or340 CloudWatch metric; confirm the workload recovered.341342If ANY verification fails, emit `VERDICT: ERROR` with the failure343details — do not claim COMPLETED.344345## Output format (per operation)346347See § STRICT output contract above. The block MUST appear exactly in348that shape at the end of the response.349350### Worked example — recover-instance (stop/start)351352```text353OPERATION: stop-start354VERDICT: READY355TARGET: i-0abcdef1234567890 (state: running, system-status: impaired,356 instance-status: ok)357PRE_CHECKS:358 - [PASS] Instance exists, not terminated359 - [PASS] SystemStatus impaired (host issue), InstanceStatus ok360 - [PASS] RootDeviceType: ebs (no data loss on stop)361 - [PASS] No instance-store block devices362 - [PASS] ASG: not a member (no suspend needed)363 - [PASS] Capacity Reservation: not bound364 - [PASS] Placement: default (no cluster constraint)365STEPS:366 1. CONFIRM: About to stop and start i-0abcdef1234567890 in account367 111111111111 region us-east-1. This will RELOCATE to a new host368 (clears hardware impairment), cause 2-5 min downtime, preserve369 EBS. Proceed? (yes/no)370 2. aws ec2 stop-instances --instance-ids i-0abcdef1234567890371 3. Poll describe-instance-status every 30s until stopped372 4. aws ec2 start-instances --instance-ids i-0abcdef1234567890373 5. Poll describe-instance-status every 30s until running + ok374POST_VERIFY:375 - (pending execution)376NOTES:377 - Stop/start is correct for SystemStatus impaired. Reboot would378 keep the instance on the same impaired host.379 - Set up a CloudWatch recovery alarm for auto-recovery:380 aws cloudwatch put-metric-alarm --alarm-name recover-i-0abcdef381 --metric-name StatusCheckFailed_System --namespace AWS/EC2382 --dimensions Name=InstanceId,Value=i-0abcdef1234567890383 --threshold 1 --comparison-operator GreaterThanOrEqualToThreshold384 --period 60 --evaluation-periods 2385 --alarm-actions arn:aws:automate:us-east-1:ec2:recover386```387388## Anti-Patterns — NEVER389390- NEVER stop an instance with `RootDeviceType: instance-store`391 without explicitly warning that the root volume and all instance-392 store volumes will be LOST. Stop releases the host; no recovery393 path for ephemeral data.394395- NEVER manually stop an ASG-managed instance without first396 suspending `HealthCheck`. The ASG detects the stop, marks it397 `Unhealthy`, and terminates it — destroying in-flight work.398399- NEVER use the EC2 recover action for `InstanceStatus: impaired`.400 Recover only addresses `SystemStatus` (hardware). For OS issues,401 recover does nothing and the alarm keeps firing.402403- NEVER reboot an instance with a pending `system-reboot` scheduled404 event. The scheduled event runs automatically; a manual reboot405 masks the hardware issue and prevents AWS from applying the fix.406407- NEVER create a forensic AMI AFTER stopping or terminating the408 instance. AMI creation captures the running state. Stop clears409 in-memory state; terminate destroys the instance. AMI FIRST.410411- NEVER detach the root volume of a running instance without412 stopping it (use `--force` only if the instance is hung and stop413 is not completing). Forced detach can corrupt the filesystem.414415- NEVER assume `State: running` means the application is healthy.416 Verify the application's health check, not just EC2 status417 checks. A hung process keeps the instance `running` while idle.418419- NEVER forget to re-bind the Capacity Reservation on start. Stop420 releases the binding; start without `--capacity-reservation-421 specification` loses the reservation.422423- NEVER rely on `get-console-output` for historical diagnosis after424 a reboot. Each boot clears the prior log. Capture to a local425 file BEFORE any recovery action.426427- NEVER use `create-image --no-reboot` for production AMIs. It428 captures the filesystem in a potentially inconsistent state. Use429 ONLY for forensic snapshots of hung instances.430431- NEVER double-recover. If a CloudWatch recovery alarm already fired,432 check alarm history before triggering another recovery. Double-433 recovery extends downtime without fixing anything.434435- NEVER terminate an instance to "force recovery" without first436 detaching EBS volumes and capturing an AMI. Termination is437 irreversible.438439- NEVER auto-execute a state-changing EC2 recovery CLI without the440 CONFIRM gate. Stop, reboot, detach, terminate, and AMI creation441 all extend downtime or destroy data.442443## Pre-flight safety checks (run before any remediation CLI)444445- **MANDATORY CONFIRMATION GATE.** Before any state-changing446 operation, emit the CONFIRM prompt. Do NOT execute until the447 operator confirms.448449- Full defense-in-depth checklist (pre-state capture commands, AMI-first, ASG suspension, Capacity Reservation re-targeting, placement-group capacity): [Advanced patterns](references/advanced-patterns.md).450## Expert heuristic: stop/start vs. reboot451452The single highest-leverage decision in EC2 recovery is:453454> **Stop/start relocates the instance to a new physical host. Reboot455> stays on the same host.** Match the operation to the impairment:456> `SystemStatus: impaired` → stop/start (host is bad). `InstanceStatus:457> impaired` → reboot or SSM access (host is fine, OS is not). Never458> use reboot for a hardware impairment — the instance stays on the459> broken host and the impairment persists.460461**Why this matters:** Operators frequently confuse reboot with462stop/start. Both appear to "restart" the instance, but they have463opposite effects on the physical host. A reboot on an impaired host464extends the outage. A stop/start on an OS issue adds 2-5 minutes of465downtime without fixing anything.466467**Decision matrix:**468469| Symptom | Operation | Why |470|---|---|---|471| `SystemStatus: impaired`, `InstanceStatus: ok` | Stop/start OR CloudWatch recover | Host hardware bad |472| `InstanceStatus: impaired`, `SystemStatus: ok` | Reboot OR SSM session | OS hung |473| Both `impaired` | Diagnose first (console, ENI) | Could be network/ENI |474| `State: running`, no SSH/SSM | EBS detach/attach for filesystem repair | OS unreachable |475| ASG-managed, health checks failing | ASG-managed replacement | ASG is the recovery loop |476| Pending `system-reboot` event | Wait for AWS | Manual reboot masks the issue |477| Pending `instance-stop` event | Stop/start BEFORE the window | Proactively relocate |478479**Surface in the output:** for any recovery, include480`HOST_CHANGE: <yes | no>` and `DATA_LOSS_RISK: <yes | no>`. If481`DATA_LOSS_RISK: yes` and the operator has not acknowledged, BLOCK.482483**Verification protocol (apply on every recovery):**4844851. **Status check restoration:** `describe-instance-status` — both486 `SystemStatus` and `InstanceStatus` return `ok`.4872. **Application health:** hit the workload's health endpoint. EC2488 status checks do not verify the application.4893. **EBS integrity:** `describe-volumes` — all volumes `in-use`.4904. **Capacity Reservation:** confirm the binding (if applicable).4915. **Console output:** capture post-recovery console log.492493## References (load on demand)494495- [Worked examples](references/worked-examples.md) - detach-attach-ebs (COMPLETED) and diagnose-impaired (BLOCKED) walkthroughs496- [Error handling](references/error-handling.md) - malformed-input VERDICT: ERROR protocol497- [Diagnostic commands](references/diagnostic-commands.md) - live-account pre-flight command listing498- [Advanced patterns](references/advanced-patterns.md) - expert behaviors, defense-in-depth safety checklist, 2024-2026 features499- [Status check deep dive](references/status-check-deep-dive.md) - System vs Instance status, stop/start vs reboot attribute tables500- [Recovery procedures](references/recovery-procedures.md) - per-archetype diagnostic and recovery procedures501502## Domain503504AWS CloudOps / EC2 Instance Recovery, Compute Resilience, and505Forensic Preservation.506507## AWS documentation508509- **EC2 User Guide — Recover your instance** — https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-instance-recover.html510- **Status checks** — https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/monitoring-system-instance-status-check.html511- **CloudWatch recover action** — https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/UsingAlarmActions.html512- **EC2 Serial Console** — https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-serial-console.html513- **SSM Session Manager** — https://docs.aws.amazon.com/systems-manager/latest/userguide/session-manager.html514- **ASG health checks** — https://docs.aws.amazon.com/autoscaling/ec2/userguide/healthcheck.html515- **EBS volumes** — https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ebs-attaching-volume.html516- **Capacity Reservations** — https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/capacity-reservations-using.html517- **Placement groups** — https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/placement-groups.html518- **EC2 API Reference** — https://docs.aws.amazon.com/AWSEC2/latest/APIReference/