[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M7A7FFXWPH9Z8C8CKETVKTHX":3,"skill-same:01M7A7FFXWPH9Z8C8CKETVKTHX":151},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":18,"publishedAt":19,"linkOnly":20,"markdownContent":21,"markdownBody":22,"frontMatter":23,"refName":43,"commitSha":44,"skillDirectory":45,"forksCount":46,"repositoryHtmlUrl":47,"repositoryHomepageUrl":6,"ownerHtmlUrl":48,"ownerBlogUrl":6,"ownerDescription":49,"updatedAt":50,"install":51,"resources":64},"01M7A7FFXWPH9Z8C8CKETVKTHX","ec2-spot-interruption-operator",null,"Operates Amazon EC2 Spot Instance interruption handling workflows end-to-end — EventBridge Instance Interruption Warning (2-minute notice), Spot Instance Interruption Queue (SQS), Lambda functions for graceful shutdown (drain from ELB, checkpoint state to S3 or DynamoDB), capacity rebalance notifications, replacement strategy selection (capacity-optimized vs diversified vs lowest-price), Spot Fleet auto-replacement, Auto Scaling Group capacity rebalance, stateful workload checkpointing patterns (S3 multipart, DynamoDB point-in-time), Spot Block deprecation awareness, Spot placement score for capacity assessment, instance diversification across families and AZs (minimum 3 families for 99.9% availability), hibernate vs stop vs terminate on interruption behavior, and integration with Application Load Balancer \u002F Network Load Balancer connection draining. Runs deterministic pre-checks (EventBridge rule health, SQS queue depth, Lambda concurrency, deregister delay, lifecycle hook timeout) behind a CONFIRM gate...","jhkchan\u002Faws-agent-skills","jhkchan","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F1083902?v=4","01M7A2SVQYP9GQTPTDXP5JKYQ4","Jacky Chan","01M7A2SVS117YWCTZABB75HZR1",4,"Apache-2.0","https:\u002F\u002Fgithub.com\u002Fjhkchan\u002Faws-agent-skills\u002Fblob\u002Fmain\u002Fskills\u002Fec2-spot-interruption-operator\u002FSKILL.md",[],[],"2026-11-15 14:19:17",false,"---\nname: ec2-spot-interruption-operator\ndescription: Operates Amazon EC2 Spot Instance interruption handling workflows end-to-end — EventBridge Instance Interruption Warning (2-minute notice), Spot Instance Interruption Queue (SQS), Lambda functions for graceful shutdown (drain from ELB, checkpoint state to S3 or DynamoDB), capacity rebalance notifications, replacement strategy selection (capacity-optimized vs diversified vs lowest-price), Spot Fleet auto-replacement, Auto Scaling Group capacity rebalance, stateful workload checkpointing patterns (S3 multipart, DynamoDB point-in-time), Spot Block deprecation awareness, Spot placement score for capacity assessment, instance diversification across families and AZs (minimum 3 families for 99.9% availability), hibernate vs stop vs terminate on interruption behavior, and integration with Application Load Balancer \u002F Network Load Balancer connection draining. Runs deterministic pre-checks (EventBridge rule health, SQS queue depth, Lambda concurrency, deregister delay, lifecycle hook timeout) behind a CONFIRM gate...\nlicense: Apache-2.0\ncompatibility: 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-spot-instance-requests, describe-spot-fleet- requests, describe-instances, modify-spot-fleet-request, aws events put-rule, put-targets, aws sqs receive-message, delete-message, get-queue-attributes, aws lambda get-function-configuration, invoke, aws autoscaling describe-auto-scaling-groups, put-lifecycle-hook, aws...\nmetadata:\n  domain: aws-cloudops\n  complexity: high\n  requires_llm: 'true'\n  phase: '4'\n  supports_pipeline: 'true'\n  entry_point: 'false'\n  family: Compute\n  task_type: operate\n  skill_class: capability\n  lifecycle_status: active\n  verdict_shape: OPERATION_COMPLETED | REVIEW_REQUIRED\n  when_to_use: 'Handling a live Spot Instance Interruption Warning (the 2-minute notice), configuring an EventBridge rule plus SQS queue plus Lambda pipeline for graceful shutdown, tuning a Spot Fleet or ASG for capacity rebalance and auto-replacement, selecting a replacement strategy (capacity-optimized, diversified, lowest-price), validating Spot placement score before a launch, auditing instance diversification across families and AZs (target: minimum 3 instance families for 99.9% availability), configuring stateful workload checkpointing to S3 or DynamoDB, or auditing the interruption-handling pipeline health.'\n  activation_triggers: Spot interruption warning, Spot Instance interrupted, 2-minute warning Spot, graceful shutdown Spot, drain Spot from ELB, checkpoint Spot instance, capacity rebalance Spot, Spot Fleet replacement, ASG capacity rebalance, Spot placement score, instance diversification Spot, Spot Block deprecation, hibernate Spot instance, Spot graceful shutdown pipeline, Spot interruption queue\n  invocation_schema: 'Input: either (a) a Spot Instance or Spot Fleet configuration (describe-spot-instance-requests, describe-spot-fleet-requests, or describe-auto-scaling-groups output) plus the intended operation (handle-interruption, configure-pipeline, tune-replacement-strategy, audit-diversification, validate-placement-score, configure-checkpointing, audit-pipeline-health), OR (b) an EventBridge Instance Interruption Warning event for live handling. Output: deterministic OPERATION \u002F VERDICT \u002F PRE_CHECKS \u002F STEPS \u002F POST_VERIFY \u002F NOTES block per operation, where VERDICT is OPERATION_COMPLETED or REVIEW_REQUIRED.'\n  version: 0.1.0\n  author: Jacky Chan — AWS Community Builder\n  keywords: Spot Instance, Spot interruption, 2-minute warning, Instance Interruption Warning, EventBridge Spot, SQS interruption queue, graceful shutdown, drain from ELB, checkpoint state, capacity rebalance, capacity-optimized, diversified allocation, Spot Fleet, ASG capacity rebalance, stateful checkpointing, Spot placement score, instance diversification, hibernate on interruption, Spot Block deprecation, Spot two-minute warning\n  tags: aws, ec2, spot, compute, interruption, autoscaling, eventbridge, operate\n---\n\n# EC2 Spot Instance Interruption Operator\n\n## What this skill does\n\nExecutes EC2 Spot Instance interruption-handling operations correctly and\nsafely. Runs deterministic pre-checks before any state-changing CLI\n(EventBridge rule is ENABLED, SQS queue is healthy with acceptable depth,\nLambda graceful-shutdown function is Active with sufficient concurrency,\nALB\u002FNLB target group deregistration delay is configured, ASG lifecycle\nhook timeout accommodates the 2-minute window, Spot Fleet or ASG has a\nvalid replacement strategy with sufficient diversification), executes\nthe graceful-shutdown pipeline behind a CONFIRM gate, and verifies the\nresult by confirming the interrupted instance was drained from the load\nbalancer, state was checkpointed, replacement launched, and the\napplication's error rate stayed within the tolerance band. Every\ninterruption-warning handler produces the drain-and-checkpoint sequence;\nevery fleet tuning surfaces the capacity-optimized recommendation and\nthe 3-family diversification minimum.\n\n## Quick navigation\n\n| Section | What it covers | When to read it |\n|---|---|---|\n| **§ Quick reference** | Verdict thresholds (REVIEW_REQUIRED\u002FOPERATION_COMPLETED) + pre-check priority | Before any operation |\n| **§ Mindset** | Why the 2-minute warning is the safety window, capacity-optimized as the default, diversification math | Understanding the safety model |\n| **§ Pre-flight** | Spot\u002FFleet\u002FASG metadata gate — state, capacity, allocation strategy, diversification | Before executing any CLI |\n| **§ Process** | Per-operation planning: handle-interruption, configure-pipeline, tune-replacement, audit-diversification, validate-placement, configure-checkpointing, audit-health | When choosing which operation to run |\n| **§ Output format** | Structured OPERATION\u002FVERDICT\u002FPRE_CHECKS\u002FSTEPS\u002FPOST_VERIFY template | Formatting the response |\n| **§ Anti-Patterns** | NEVER list — common mistakes that lose in-flight work or strand the fleet below capacity | Review before risky operations |\n| **§ Pre-flight safety** | Capture pre-state, verify pipeline health, validate checkpoint target | Defense-in-depth |\n\n## Quick reference — verdict thresholds\n\n| Verdict | Trigger condition | Action |\n|---|---|---|\n| `REVIEW_REQUIRED` | Operation plan is ready but requires human review before execution (replacing lowest-price with capacity-optimized changes billing behavior, reducing a Spot Fleet's target capacity below current running count, changing the interruption behavior from terminate to hibernate or stop, modifying an ASG lifecycle hook that affects in-flight deployments, enabling capacity rebalance on a production ASG) | Emit plan with the specific items to review, wait for operator approval |\n| `OPERATION_COMPLETED` | Interruption handling finished and post-verification passed (instance drained from ELB, state checkpointed to S3 or DynamoDB, replacement launched, ASG\u002FFleet capacity restored, application error rate within tolerance) | Emit verification results, monitoring plan |\n\n**Priority order for pre-checks (apply in this sequence, any failure routes\nto REVIEW_REQUIRED with the failure surfaced):**\n\n1. **Spot request reachability** — the Spot Instance Request exists and\n   `State: active` (not `cancelled`, `closed`, `failed`). The instance\n   itself is `running`.\n2. **EventBridge rule health** — the\n   `EC2 Spot Instance Interruption Warning` rule is `ENABLED`, targets\n   the SQS queue or Lambda function, and the rule's event pattern\n   matches `\"detail-type\": [\"EC2 Spot Instance Interruption Warning\"]`.\n3. **SQS queue health** — the interruption queue is healthy:\n   `ApproximateNumberOfMessagesVisible` is not climbing (no consumer\n   lag), `ApproximateAgeOfOldestMessage` is under the 2-minute window\n   threshold, the dead-letter queue is empty.\n4. **Lambda graceful-shutdown function** — `State: Active`,\n   `ReservedConcurrentExecutions >= 1` (not the stealth-throttle\n   condition), timeout >= 60 seconds (enough for drain + checkpoint\n   within the 2-minute window), runtime is a supported version.\n5. **ALB\u002FNLB target group** — the instance is a registered target,\n   `deregistration_delay.timeout_seconds` is set to a value that allows\n   in-flight requests to complete (typically 30-60 seconds).\n6. **ASG lifecycle hook** — if the instance is in an ASG, the\n   `InstanceLaunching` and `InstanceTerminating` lifecycle hooks have\n   timeouts that accommodate the 2-minute window (default 60 minutes\n   for launching, but the termination hook should be at least 120\n   seconds to give the graceful-shutdown pipeline room).\n7. **Replacement strategy** — the Spot Fleet or ASG has a valid\n   allocation strategy (`capacity-optimized` recommended,\n   `capacity-optimized-prioritized`, `diversified`,\n   `lowest-price` with multiple pools).\n8. **Diversification** — the Spot Fleet or ASG specifies at least 3\n   instance families across at least 3 AZs (the minimum for 99.9%\n   availability per the AWS Spot best-practices guidance).\n9. **Capacity rebalance** — `AllocationStrategy` on the ASG or Spot\n   Fleet supports capacity rebalance (or is explicitly enabled via\n   `CapacityRebalance` on the ASG).\n\n**Cost\u002Ftime baselines (2026):**\n\n- EventBridge Instance Interruption Warning: delivered 2 minutes (120\n  seconds) before the actual interruption. This is the maximum\n  graceful-shutdown window. Some interruption types (capacity-reclaim)\n  may provide less notice in practice — design for 90 seconds to be\n  safe.\n- ELB target deregistration: enters `draining` state, waits\n  `deregistration_delay.timeout_seconds` (default 300 seconds for ALB,\n  configurable 0-3600). Within the 2-minute window, set this to 30-60\n  seconds to leave room for checkpointing.\n- Lambda graceful-shutdown execution: typically 10-45 seconds (drain\n  from ELB, write checkpoint to S3, signal the application to flush).\n- Spot Fleet auto-replacement: the Fleet launches a replacement within\n  seconds of the interruption. Provisioning time depends on the AMI\n  and instance type (30 seconds to 3 minutes).\n- Spot placement score: a single API call\n  (`get-spot-placement-scores`) returns in under 5 seconds for up to\n  50,000 capacity combinations.\n\n## Mindset\n\n**One-line takeaway:** the 2-minute Instance Interruption Warning is\nthe safety window — it is enough time to drain from the load balancer\nand checkpoint state, but only if the pipeline is pre-wired and tested.\nSpot is NOT unreliable; it is a different reliability model that\nrewards diversification and graceful shutdown. Driven by three EC2\nSpot realities:\n\n- **The 2-minute warning allows graceful shutdown (drain + checkpoint).**\n  When EC2 reclaims a Spot Instance, EventBridge emits an\n  `EC2 Spot Instance Interruption Warning` event 2 minutes before the\n  actual interruption. A Lambda function (or any event consumer) can\n  use this window to deregister the instance from the load balancer,\n  flush in-flight transactions, write a checkpoint to S3 or DynamoDB,\n  and signal the application to shut down cleanly. Without this\n  pipeline, the instance is terminated with no warning and all in-\n  flight work is lost.\n\n- **Capacity-optimized allocation strategy minimizes interruptions.**\n  The `capacity-optimized` strategy (and its\n  `capacity-optimized-prioritized` variant) launches Spot Instances\n  from the pools with the lowest interruption rates, rather than the\n  lowest price. This reduces the frequency of interruptions at a\n  marginally higher cost. For production workloads, capacity-optimized\n  is the default recommendation — the cost saving from `lowest-price`\n  is eaten by the disruption of frequent interruptions.\n\n- **Diversify across at least 3 instance families for 99.9%\n  availability.** Spot interruption rates vary by instance family, AZ,\n  and time of day. A fleet that runs on a single instance type in a\n  single AZ is at high risk of a simultaneous reclaim. Diversifying\n  across at least 3 instance families (e.g., `m5`, `m6a`, `c6g`) and\n  at least 3 AZs gives a 99.9% availability profile for Spot — the\n  mathematical basis is that the probability of all pools being\n  interrupted simultaneously drops exponentially with the number of\n  independent pools.\n\n## Pre-flight: Spot\u002FFleet\u002FASG metadata gate\n\nRun before classification. Misclassifying these produces wrong plans.\n\n**Pagination:** `describe-spot-instance-requests` paginates at 1,000\u002Fpage\n— drain `--next-token` to completion. Filter by `--state active`.\n\n**Live-account pre-flight (skip if offline plan audit):** the 7 read-only commands\n(describe-spot-instance-requests ... autoscaling describe-auto-scaling-groups) are listed in [Diagnostic commands](references\u002Fdiagnostic-commands.md).\n\nMalformed-input protocol (VERDICT: ERROR + REMEDIATION): see [Error handling](references\u002Ferror-handling.md).\n\n| Spot\u002FFleet\u002FASG attribute | Effect on operation |\n|---|---|\n| `State: cancelled` or `closed` | Spot request no longer active. Instance may still be running but is not managed by the Spot service. |\n| `InstanceInterruptionBehavior: terminate` | Default. Instance is terminated on interruption. No state preserved. |\n| `InstanceInterruptionBehavior: stop` | Instance is stopped (EBS-backed only). Can be restarted when capacity returns. |\n| `InstanceInterruptionBehavior: hibernate` | Instance hibernates (memory state saved to EBS). Requires the instance to be hibernation-enabled at launch. |\n| EventBridge rule `State: DISABLED` | Interruption warnings are NOT delivered. The graceful-shutdown pipeline is dark. |\n| SQS `ApproximateAgeOfOldestMessage > 120` | Messages are older than the 2-minute window — the consumer (Lambda) is lagging. Interruption warnings in the queue are already stale. |\n| Lambda `ReservedConcurrentExecutions: 0` | Stealth throttle. The graceful-shutdown Lambda will never execute. Every interruption is a hard termination. |\n| Lambda `Timeout \u003C 60` | May not complete drain + checkpoint within the 2-minute window. |\n| Spot Fleet `AllocationStrategy: lowestPrice` with 1 pool | High interruption risk. Recommend switching to capacity-optimized with >= 3 pools. |\n| Spot Fleet `FulfilledCapacity \u003C TargetCapacity` | Fleet is below target — instances are being interrupted faster than replacements launch. |\n| ASG `CapacityRebalance: false` | Capacity rebalance is off. The ASG does not proactively replace at-risk instances. |\n| ASG `MixedInstancesPolicy` with 1 instance type | No diversification. High risk of simultaneous reclaim. |\n\n## Process — operation planning (apply in order)\n\n### Step 0: Expert knowledge - non-obvious EC2 Spot interruption behaviors (condensed)\n\n- The 2-minute warning is a maximum, not a guarantee - design the pipeline to finish within 90 seconds. EventBridge is the ONLY notification channel.\n- `InstanceInterruptionBehavior` is set at launch and immutable (terminate \u002F stop \u002F hibernate).\n- Capacity rebalance is proactive (launches replacements BEFORE the warning). Prefer `capacity-optimized` over `lowest-price` for production.\n- Diversification math: 3 families x 3 AZs = 9 pools for 99.9% availability. Spot placement score is a forecast, not a guarantee.\n- Spot Block is deprecated (2024+). ELB deregistration delay must fit within 2 minutes; lifecycle hooks fire on termination, not the warning.\n- Full deep dives (Graviton rates, StatusCode early warning, Fleet auto-replacement): [Advanced patterns](references\u002Fadvanced-patterns.md).\n\n### Step 1: Pre-check gate — REVIEW_REQUIRED if any check needs human attention\n\nRun ALL pre-checks for the chosen operation. If any check fails or\nrequires human review, the verdict is REVIEW_REQUIRED with the specific\nitems listed. Do NOT execute until the operator reviews.\n\n**For ALL operations:**\n1. Spot Instance Request exists and `State: active`.\n2. Instance is `running`.\n3. EventBridge interruption-warning rule is `ENABLED`.\n4. SQS queue (or Lambda target) is healthy — no consumer lag.\n\n**For handle-interruption (live EventBridge warning event):**\n5. Event `detail.instance-action` determines shutdown sequence\n   (`terminate`, `stop`, or `hibernate`).\n6. Instance registered to a target group. Lambda `Active` with\n   reserved concurrency >= 1, timeout >= 60. Checkpoint target exists.\n7. The 2-minute window has not already elapsed.\n\n**For configure-pipeline (set up EventBridge + SQS + Lambda):**\n5. EventBridge pattern matches `\"EC2 Spot Instance Interruption\n   Warning\"`. SQS queue has DLQ configured.\n6. Lambda timeout >= 60. Lambda role has `ec2:DescribeInstances`,\n   `elasticloadbalancing:DeregisterTargets`, `s3:PutObject`.\n7. Target group `deregistration_delay.timeout_seconds` is 30-60s.\n\n**For tune-replacement-strategy (modify Fleet or ASG):**\n5. Current `AllocationStrategy` identified. Proposed strategy is\n   `capacity-optimized` (recommended) or `diversified` with >= 3 pools.\n6. For ASGs: `CapacityRebalance` enabled. `ExcessCapacityTerminationPolicy`\n   reviewed (default `true`).\n\n**For audit-diversification (read-only):**\n5. Fleet\u002FASG `Overrides` lists all instance types and AZs.\n6. Count of unique instance families >= 3, unique AZs >= 3.\n   Graviton included (recommended).\n\n**For validate-placement-score (read-only):**\n5. `get-spot-placement-scores` called. Score >= 7 good, 4-6 marginal,\n   \u003C= 3 avoid.\n\n**For configure-checkpointing (stateful workload):**\n5. Checkpoint target exists. Application supports checkpoint signals\n   (SIGTERM handler). Checkpoint frequency configured. Restore path\n   tested.\n\n**For audit-pipeline-health (read-only):**\n5. EventBridge `ENABLED`. SQS `ApproximateAgeOfOldestMessage` \u003C 120s.\n   DLQ empty. Lambda `Active`, reserved concurrency >= 1. ELB delay\n   30-60s.\n\nInterruption-handling failure-mode table (Lambda never invoked, ELB still sending traffic, Fleet did not auto-replace, etc.): see [Error handling](references\u002Ferror-handling.md).\n\n### Step 2: OPERATION_COMPLETED or REVIEW_REQUIRED — emit operation plan\n\nIf all pre-checks pass AND the operation is read-only or low-risk\n(audit-diversification, validate-placement-score, audit-pipeline-health,\nhandle-interruption where the pipeline executes successfully), emit\n`VERDICT: OPERATION_COMPLETED` (for already-finished operations) or\nthe executable plan with the CONFIRM gate.\n\nFor operations requiring human review (tune-replacement-strategy changes\nthe allocation strategy, configure-pipeline on a production ASG, enabling\ncapacity rebalance, changing `InstanceInterruptionBehavior`), emit\n`VERDICT: REVIEW_REQUIRED` with the specific items to review. The plan\nincludes:\n\n- The exact AWS CLI command with all flags populated from the Spot\u002FFleet\u002F\n  ASG configuration.\n- The expected duration (Lambda execution 10-45 seconds; Spot Fleet\n  replacement launch 30 seconds to 3 minutes; ASG capacity rebalance\n  proactive replacement within minutes).\n- The expected side-effects (instance deregistered, replacement launched,\n  capacity restored, checkpoint written).\n- The CONFIRM gate prompt.\n- The monitoring step (CloudWatch metrics for `SpotInstanceInterruptionCount`,\n  ELB `HealthyHostCount`, Lambda errors).\n\n### Step 3: Execute behind CONFIRM gate\n\n- **MANDATORY CONFIRMATION GATE.** Before any state-changing CLI\n  (`modify-spot-fleet-request`, `deregister-targets`,\n  `update-function-configuration`, `put-rule`, `put-targets`,\n  `update-auto-scaling-group`, `put-lifecycle-hook`,\n  `terminate-instances`), emit: `CONFIRM: About to \u003Coperation> on\n  \u003Ctarget> in account \u003Caccount> region \u003Cregion>. This will\n  \u003Cconsequence>. Proceed? (yes\u002Fno)`. Do NOT execute until the operator\n  confirms.\n- Capture pre-state for audit: `aws ec2 describe-spot-instance-requests\n  --spot-instance-request-id \u003Cid> --output json > \u002Ftmp\u002F\u003Cid>-pre-$(date\n  +%s).json`.\n- For handle-interruption: the Lambda function is invoked by\n  EventBridge (or manually for testing). The Lambda deregisters the\n  instance from the ELB, writes a checkpoint, and signals the\n  application to shut down. Monitor via:\n  `aws logs tail \u002Faws\u002Flambda\u002F\u003Cfn> --follow --since 2m`.\n- For tune-replacement-strategy: execute the\n  `modify-spot-fleet-request` or `update-auto-scaling-group`. The\n  change is immediate — new launches use the new strategy. Existing\n  instances are not restarted.\n\n### Step 4: Post-verification — OPERATION_COMPLETED\n\nAfter the operation finishes, run post-verification. ALL checks must\npass for `OPERATION_COMPLETED`.\n\n1. For handle-interruption: confirm the instance was deregistered from\n   the ELB (`describe-target-health` shows `TargetHealth.State: unused`\n   or the target is gone), the checkpoint was written to S3 or\n   DynamoDB (verify the object or item exists with a recent\n   timestamp), and the replacement launched (Spot Fleet\n   `FulfilledCapacity` is back to `TargetCapacity`, or ASG\n   `DesiredCapacity` is met).\n2. For configure-pipeline: test the pipeline by emitting a synthetic\n   interruption event (`aws events put-events` with a test payload) and\n   confirm the Lambda executes successfully.\n3. For tune-replacement-strategy: confirm the\n   `AllocationStrategy` changed via `describe-spot-fleet-requests` or\n   `describe-auto-scaling-groups`. Monitor for the next 24 hours —\n   the interruption rate should decrease with `capacity-optimized`.\n4. For audit-diversification: report the count of unique instance\n   families and AZs. Flag if below the 3 x 3 minimum.\n5. For audit-pipeline-health: report the health of each component\n   (EventBridge, SQS, Lambda, ELB target group, ASG lifecycle hook).\n6. Application error rate: confirm the ELB `HTTPCode_ELB_5XX_Count`\n   and `TargetConnectionErrorCount` metrics did not spike during the\n   interruption handling window.\n7. Checkpoint integrity: for stateful workloads, verify the\n   replacement loaded the checkpoint and resumed from the correct\n   state.\n\nIf ANY verification fails, emit `VERDICT: ERROR` with the failure\ndetails — do not claim OPERATION_COMPLETED. A failed verification\ntypically means the pipeline is misconfigured (Lambda timeout, missing\npermissions, ELB delay too long) or the diversification is insufficient.\n\n## Output format (per operation)\n\n```text\nOPERATION: \u003Chandle-interruption | configure-pipeline | tune-replacement-strategy | audit-diversification | validate-placement-score | configure-checkpointing | audit-pipeline-health>\nVERDICT: OPERATION_COMPLETED | REVIEW_REQUIRED\nTARGET: \u003Cspot-instance-id-or-fleet-id-or-asg-name> (strategy: \u003Ccurrent>, target: \u003Ctarget-config>)\nPRE_CHECKS:\n  - [PASS] \u003Ccheck description>\n  - [REVIEW] \u003Ccheck description> — \u003Citem to review>\nSTEPS:\n  1. \u003CCLI command with flags populated>\n  2. \u003Cwait \u002F monitoring command>\n  3. \u003Cnext step>\nPOST_VERIFY:\n  - [PASS] \u003Cverification description>\n  - [FAIL] \u003Cverification description> — \u003Creason>\nNOTES: \u003Cmonitoring, caveats, diversification recommendation>\n```\n\n### Worked example — handle-interruption (OPERATION_COMPLETED)\n\n```text\nOPERATION: handle-interruption\nVERDICT: OPERATION_COMPLETED\nTARGET: i-0abc123def456 (Spot Fleet: sfr-abc123, ASG: prod-web-asg)\nPRE_CHECKS:\n  - [PASS] EventBridge warning received: instance-action=terminate,\n    event time 2026-08-11T14:23:00Z (105 seconds remaining in window)\n  - [PASS] Instance i-0abc123def456 registered to target group\n    arn:aws:elasticloadbalancing:us-east-1:111111111111:targetgroup\u002Fprod-web-tg\u002F...\n  - [PASS] Graceful-shutdown Lambda prod-spot-shutdown State: Active,\n    Timeout: 90, ReservedConcurrentExecutions: 10\n  - [PASS] Lambda execution role has elasticloadbalancing:DeregisterTargets,\n    s3:PutObject on arn:aws:s3:::prod-checkpoints\u002F*\n  - [PASS] ELB deregistration_delay.timeout_seconds: 45 (fits within\n    the 2-minute window)\n  - [PASS] ASG InstanceTerminating lifecycle hook HeartbeatTimeout: 120\nSTEPS:\n  1. Lambda prod-spot-shutdown invoked by EventBridge at 14:23:01Z.\n  2. Lambda deregistered i-0abc123def456 from target group\n     (deregistration draining started at 14:23:03Z).\n  3. Lambda sent SIGTERM to the application process (via SSM\n     SendCommand) — application flushed in-flight requests and wrote\n     checkpoint to s3:\u002F\u002Fprod-checkpoints\u002Fi-0abc123def456\u002Fstate.json\n     (completed 14:23:38Z).\n  4. ELB target entered \"unused\" state at 14:23:48Z (45s drain).\n  5. Instance terminated by Spot service at 14:25:00Z.\n  6. ASG launched replacement i-0new456 (capacity-optimized, m6a.large\n     in us-east-1b) at 14:25:15Z. Replacement \"running\" at 14:27:45Z.\n  7. Replacement registered to target group, health checks passing at\n     14:28:30Z.\nPOST_VERIFY:\n  - [PASS] i-0abc123def456 deregistered from target group\n  - [PASS] Checkpoint written: s3:\u002F\u002Fprod-checkpoints\u002Fi-0abc123def456\u002Fstate.json\n    (timestamp 2026-08-11T14:23:38Z)\n  - [PASS] Spot Fleet FulfilledCapacity: 10 (matches TargetCapacity)\n  - [PASS] Replacement i-0new456 TargetHealth.State: healthy\n  - [PASS] ELB HTTPCode_ELB_5XX_Count: no spike during the window\n  - [PASS] Application resumed from checkpoint on replacement\nNOTES:\n  - Total handling time: 35 seconds (deregister + checkpoint + flush).\n    Well within the 2-minute window.\n  - Spot Fleet auto-replaced the interrupted instance via the\n    capacity-optimized allocation strategy. Replacement launched in\n    us-east-1b (different AZ from the interrupted instance, which was\n    in us-east-1a).\n  - The ASG CapacityRebalance was enabled — a proactive replacement\n    was already in progress when the interruption warning fired,\n    reducing the effective gap to zero.\n```\n\n## Anti-Patterns — NEVER\n\n- NEVER rely on Spot without a graceful-shutdown pipeline. Without\n  EventBridge + a consumer, the instance is terminated with no warning.\n  The 2-minute warning is the ONLY notification channel.\n\n- NEVER set the ELB deregistration delay longer than the 2-minute\n  window. The default ALB delay of 300 seconds means the instance is\n  terminated before draining finishes. Set to 30-60 seconds for Spot.\n\n- NEVER use `lowest-price` with a single pool for production. Use\n  `capacity-optimized` with 3+ families across 3+ AZs. The 5-8% cost\n  premium is offset by the 5-10x reduction in interruptions.\n\n- NEVER assume the 2-minute warning is always exactly 120 seconds.\n  Design the pipeline to complete within 90 seconds.\n\n- NEVER change `InstanceInterruptionBehavior` on a running instance —\n  it is set at launch and immutable.\n\n- NEVER forget the Lambda resource-based policy for EventBridge\n  (`events.amazonaws.com`). Without it, direct Lambda invocation fails\n  silently.\n\n- NEVER use Spot Block for new capacity — it is deprecated (2024+).\n  Use On-Demand Capacity Reservations for predictable capacity.\n\n- NEVER rely on hibernate as the only state-preservation. Hibernate\n  saves memory to EBS but EC2 may terminate the instance afterward.\n  Use application-level checkpointing to S3 or DynamoDB.\n\n- NEVER ignore SQS queue depth. Messages older than 120 seconds are\n  stale — the instance is already terminated. Set a CloudWatch alarm.\n\n- NEVER diversify across instance types within a single family only.\n  `c5.large`, `c5.xlarge`, `c5.2xlarge` share the same pools. Mix\n  families (`c5`, `m5`, `c6g`) for true independence.\n\n- NEVER assume Spot Fleet auto-replacement restores state. Replacements\n  start from scratch — stateful workloads must checkpoint independently.\n\n- NEVER auto-execute a state-changing Spot CLI without the CONFIRM gate.\n  Allocation strategy, target capacity, and interruption behavior\n  changes affect billing and availability.\n\n- NEVER assume capacity rebalance eliminates all interruptions. It is\n  proactive but cannot prevent every reclaim. The graceful-shutdown\n  pipeline is still required.\n\n- NEVER forget to test the pipeline with a synthetic event. The first\n  real interruption is NOT the time to discover the pipeline is broken.\n\n## Pre-flight safety checks (run before any remediation CLI)\n\n- **MANDATORY CONFIRMATION GATE.** Before any state-changing operation\n  (`modify-spot-fleet-request`, `update-auto-scaling-group`,\n  `put-lifecycle-hook`, `modify-target-group-attributes`,\n  `terminate-instances`, `deregister-targets`,\n  `update-function-configuration`, `put-rule`, `put-targets`),\n  emit: `CONFIRM: About to \u003Coperation> on \u003Ctarget> in account\n  \u003Caccount> region \u003Cregion>. This will \u003Cconsequence>. Proceed?\n  (yes\u002Fno)`.\n\n- **Capture pre-state for audit.** `describe-spot-fleet-requests` or\n  `describe-auto-scaling-groups` JSON saved to `\u002Ftmp\u002F\u003Cid>-pre-$(date\n  +%s).json`.\n\n- **Verify pipeline health.** EventBridge rule `ENABLED`. SQS queue\n  depth stable, oldest message under 120s, DLQ configured. Lambda\n  `State: Active`, `Timeout >= 60`, reserved concurrency not 0. ELB\n  `deregistration_delay.timeout_seconds` 30-60s for Spot targets. ASG\n  lifecycle hook `HeartbeatTimeout >= 120`.\n\n- **Verify diversification.** At least 3 instance families across 3\n  AZs. Use `capacity-optimized` allocation strategy. Enable\n  `CapacityRebalance` on ASGs for proactive replacement.\n\n## References (load on demand)\n\n- [Worked examples](references\u002Fworked-examples.md) - tune-replacement-strategy (REVIEW_REQUIRED) and configure-pipeline walkthroughs\n- [Error handling](references\u002Ferror-handling.md) - failure-mode table and malformed-input VERDICT: ERROR protocol\n- [Diagnostic commands](references\u002Fdiagnostic-commands.md) - live-account pre-flight command listing\n- [Advanced patterns](references\u002Fadvanced-patterns.md) - expert behaviors and 2024-2026 feature notes\n- [Diversification and strategy](references\u002Fdiversification-and-strategy.md) - allocation strategies, diversification math, placement score\n- [Graceful shutdown pipeline](references\u002Fgraceful-shutdown-pipeline.md) - EventBridge + SQS + Lambda architecture and checkpointing\n\n## Domain\n\nAWS CloudOps \u002F EC2 Spot Instance Interruption Handling, Graceful\nShutdown & Capacity Resilience.\n\n## AWS documentation\n\n- **Amazon EC2 Spot Instances** — https:\u002F\u002Fdocs.aws.amazon.com\u002FAWSEC2\u002Flatest\u002FUserGuide\u002Fusing-spot-instances.html\n- **Spot Instance interruption notices** — https:\u002F\u002Fdocs.aws.amazon.com\u002FAWSEC2\u002Flatest\u002FUserGuide\u002Fspot-interruptions.html\n- **Best practices for Spot Instances** — https:\u002F\u002Fdocs.aws.amazon.com\u002FAWSEC2\u002Flatest\u002FUserGuide\u002Fspot-best-practices.html\n- **Spot Fleet** — https:\u002F\u002Fdocs.aws.amazon.com\u002FAWSEC2\u002Flatest\u002FUserGuide\u002Fspot-fleet.html\n- **Capacity Rebalance** — https:\u002F\u002Fdocs.aws.amazon.com\u002Fautoscaling\u002Fec2\u002Fuserguide\u002Fcapacity-rebalance.html\n- **Spot Instance interruption handling** — https:\u002F\u002Fdocs.aws.amazon.com\u002FAWSEC2\u002Flatest\u002FUserGuide\u002Fhandling-spot-interruptions.html\n- **Spot Placement Score** — https:\u002F\u002Fdocs.aws.amazon.com\u002FAWSEC2\u002Flatest\u002FAPIReference\u002FAPI_GetSpotPlacementScores.html\n- **EventBridge EC2 Spot Instance Interruption Warning** — https:\u002F\u002Fdocs.aws.amazon.com\u002Feventbridge\u002Flatest\u002Fuserguide\u002Feb-service-event.html#eb-spot-instance\n- **Auto Scaling lifecycle hooks** — https:\u002F\u002Fdocs.aws.amazon.com\u002Fautoscaling\u002Fec2\u002Fuserguide\u002Flifecycle-hooks.html\n- **ELB target group deregistration delay** — https:\u002F\u002Fdocs.aws.amazon.com\u002Felasticloadbalancing\u002Flatest\u002Fapplication\u002Fload-balancer-target-groups.html#deregistration-delay\n","# EC2 Spot Instance Interruption Operator\n\n## What this skill does\n\nExecutes EC2 Spot Instance interruption-handling operations correctly and\nsafely. Runs deterministic pre-checks before any state-changing CLI\n(EventBridge rule is ENABLED, SQS queue is healthy with acceptable depth,\nLambda graceful-shutdown function is Active with sufficient concurrency,\nALB\u002FNLB target group deregistration delay is configured, ASG lifecycle\nhook timeout accommodates the 2-minute window, Spot Fleet or ASG has a\nvalid replacement strategy with sufficient diversification), executes\nthe graceful-shutdown pipeline behind a CONFIRM gate, and verifies the\nresult by confirming the interrupted instance was drained from the load\nbalancer, state was checkpointed, replacement launched, and the\napplication's error rate stayed within the tolerance band. Every\ninterruption-warning handler produces the drain-and-checkpoint sequence;\nevery fleet tuning surfaces the capacity-optimized recommendation and\nthe 3-family diversification minimum.\n\n## Quick navigation\n\n| Section | What it covers | When to read it |\n|---|---|---|\n| **§ Quick reference** | Verdict thresholds (REVIEW_REQUIRED\u002FOPERATION_COMPLETED) + pre-check priority | Before any operation |\n| **§ Mindset** | Why the 2-minute warning is the safety window, capacity-optimized as the default, diversification math | Understanding the safety model |\n| **§ Pre-flight** | Spot\u002FFleet\u002FASG metadata gate — state, capacity, allocation strategy, diversification | Before executing any CLI |\n| **§ Process** | Per-operation planning: handle-interruption, configure-pipeline, tune-replacement, audit-diversification, validate-placement, configure-checkpointing, audit-health | When choosing which operation to run |\n| **§ Output format** | Structured OPERATION\u002FVERDICT\u002FPRE_CHECKS\u002FSTEPS\u002FPOST_VERIFY template | Formatting the response |\n| **§ Anti-Patterns** | NEVER list — common mistakes that lose in-flight work or strand the fleet below capacity | Review before risky operations |\n| **§ Pre-flight safety** | Capture pre-state, verify pipeline health, validate checkpoint target | Defense-in-depth |\n\n## Quick reference — verdict thresholds\n\n| Verdict | Trigger condition | Action |\n|---|---|---|\n| `REVIEW_REQUIRED` | Operation plan is ready but requires human review before execution (replacing lowest-price with capacity-optimized changes billing behavior, reducing a Spot Fleet's target capacity below current running count, changing the interruption behavior from terminate to hibernate or stop, modifying an ASG lifecycle hook that affects in-flight deployments, enabling capacity rebalance on a production ASG) | Emit plan with the specific items to review, wait for operator approval |\n| `OPERATION_COMPLETED` | Interruption handling finished and post-verification passed (instance drained from ELB, state checkpointed to S3 or DynamoDB, replacement launched, ASG\u002FFleet capacity restored, application error rate within tolerance) | Emit verification results, monitoring plan |\n\n**Priority order for pre-checks (apply in this sequence, any failure routes\nto REVIEW_REQUIRED with the failure surfaced):**\n\n1. **Spot request reachability** — the Spot Instance Request exists and\n   `State: active` (not `cancelled`, `closed`, `failed`). The instance\n   itself is `running`.\n2. **EventBridge rule health** — the\n   `EC2 Spot Instance Interruption Warning` rule is `ENABLED`, targets\n   the SQS queue or Lambda function, and the rule's event pattern\n   matches `\"detail-type\": [\"EC2 Spot Instance Interruption Warning\"]`.\n3. **SQS queue health** — the interruption queue is healthy:\n   `ApproximateNumberOfMessagesVisible` is not climbing (no consumer\n   lag), `ApproximateAgeOfOldestMessage` is under the 2-minute window\n   threshold, the dead-letter queue is empty.\n4. **Lambda graceful-shutdown function** — `State: Active`,\n   `ReservedConcurrentExecutions >= 1` (not the stealth-throttle\n   condition), timeout >= 60 seconds (enough for drain + checkpoint\n   within the 2-minute window), runtime is a supported version.\n5. **ALB\u002FNLB target group** — the instance is a registered target,\n   `deregistration_delay.timeout_seconds` is set to a value that allows\n   in-flight requests to complete (typically 30-60 seconds).\n6. **ASG lifecycle hook** — if the instance is in an ASG, the\n   `InstanceLaunching` and `InstanceTerminating` lifecycle hooks have\n   timeouts that accommodate the 2-minute window (default 60 minutes\n   for launching, but the termination hook should be at least 120\n   seconds to give the graceful-shutdown pipeline room).\n7. **Replacement strategy** — the Spot Fleet or ASG has a valid\n   allocation strategy (`capacity-optimized` recommended,\n   `capacity-optimized-prioritized`, `diversified`,\n   `lowest-price` with multiple pools).\n8. **Diversification** — the Spot Fleet or ASG specifies at least 3\n   instance families across at least 3 AZs (the minimum for 99.9%\n   availability per the AWS Spot best-practices guidance).\n9. **Capacity rebalance** — `AllocationStrategy` on the ASG or Spot\n   Fleet supports capacity rebalance (or is explicitly enabled via\n   `CapacityRebalance` on the ASG).\n\n**Cost\u002Ftime baselines (2026):**\n\n- EventBridge Instance Interruption Warning: delivered 2 minutes (120\n  seconds) before the actual interruption. This is the maximum\n  graceful-shutdown window. Some interruption types (capacity-reclaim)\n  may provide less notice in practice — design for 90 seconds to be\n  safe.\n- ELB target deregistration: enters `draining` state, waits\n  `deregistration_delay.timeout_seconds` (default 300 seconds for ALB,\n  configurable 0-3600). Within the 2-minute window, set this to 30-60\n  seconds to leave room for checkpointing.\n- Lambda graceful-shutdown execution: typically 10-45 seconds (drain\n  from ELB, write checkpoint to S3, signal the application to flush).\n- Spot Fleet auto-replacement: the Fleet launches a replacement within\n  seconds of the interruption. Provisioning time depends on the AMI\n  and instance type (30 seconds to 3 minutes).\n- Spot placement score: a single API call\n  (`get-spot-placement-scores`) returns in under 5 seconds for up to\n  50,000 capacity combinations.\n\n## Mindset\n\n**One-line takeaway:** the 2-minute Instance Interruption Warning is\nthe safety window — it is enough time to drain from the load balancer\nand checkpoint state, but only if the pipeline is pre-wired and tested.\nSpot is NOT unreliable; it is a different reliability model that\nrewards diversification and graceful shutdown. Driven by three EC2\nSpot realities:\n\n- **The 2-minute warning allows graceful shutdown (drain + checkpoint).**\n  When EC2 reclaims a Spot Instance, EventBridge emits an\n  `EC2 Spot Instance Interruption Warning` event 2 minutes before the\n  actual interruption. A Lambda function (or any event consumer) can\n  use this window to deregister the instance from the load balancer,\n  flush in-flight transactions, write a checkpoint to S3 or DynamoDB,\n  and signal the application to shut down cleanly. Without this\n  pipeline, the instance is terminated with no warning and all in-\n  flight work is lost.\n\n- **Capacity-optimized allocation strategy minimizes interruptions.**\n  The `capacity-optimized` strategy (and its\n  `capacity-optimized-prioritized` variant) launches Spot Instances\n  from the pools with the lowest interruption rates, rather than the\n  lowest price. This reduces the frequency of interruptions at a\n  marginally higher cost. For production workloads, capacity-optimized\n  is the default recommendation — the cost saving from `lowest-price`\n  is eaten by the disruption of frequent interruptions.\n\n- **Diversify across at least 3 instance families for 99.9%\n  availability.** Spot interruption rates vary by instance family, AZ,\n  and time of day. A fleet that runs on a single instance type in a\n  single AZ is at high risk of a simultaneous reclaim. Diversifying\n  across at least 3 instance families (e.g., `m5`, `m6a`, `c6g`) and\n  at least 3 AZs gives a 99.9% availability profile for Spot — the\n  mathematical basis is that the probability of all pools being\n  interrupted simultaneously drops exponentially with the number of\n  independent pools.\n\n## Pre-flight: Spot\u002FFleet\u002FASG metadata gate\n\nRun before classification. Misclassifying these produces wrong plans.\n\n**Pagination:** `describe-spot-instance-requests` paginates at 1,000\u002Fpage\n— drain `--next-token` to completion. Filter by `--state active`.\n\n**Live-account pre-flight (skip if offline plan audit):** the 7 read-only commands\n(describe-spot-instance-requests ... autoscaling describe-auto-scaling-groups) are listed in [Diagnostic commands](references\u002Fdiagnostic-commands.md).\n\nMalformed-input protocol (VERDICT: ERROR + REMEDIATION): see [Error handling](references\u002Ferror-handling.md).\n\n| Spot\u002FFleet\u002FASG attribute | Effect on operation |\n|---|---|\n| `State: cancelled` or `closed` | Spot request no longer active. Instance may still be running but is not managed by the Spot service. |\n| `InstanceInterruptionBehavior: terminate` | Default. Instance is terminated on interruption. No state preserved. |\n| `InstanceInterruptionBehavior: stop` | Instance is stopped (EBS-backed only). Can be restarted when capacity returns. |\n| `InstanceInterruptionBehavior: hibernate` | Instance hibernates (memory state saved to EBS). Requires the instance to be hibernation-enabled at launch. |\n| EventBridge rule `State: DISABLED` | Interruption warnings are NOT delivered. The graceful-shutdown pipeline is dark. |\n| SQS `ApproximateAgeOfOldestMessage > 120` | Messages are older than the 2-minute window — the consumer (Lambda) is lagging. Interruption warnings in the queue are already stale. |\n| Lambda `ReservedConcurrentExecutions: 0` | Stealth throttle. The graceful-shutdown Lambda will never execute. Every interruption is a hard termination. |\n| Lambda `Timeout \u003C 60` | May not complete drain + checkpoint within the 2-minute window. |\n| Spot Fleet `AllocationStrategy: lowestPrice` with 1 pool | High interruption risk. Recommend switching to capacity-optimized with >= 3 pools. |\n| Spot Fleet `FulfilledCapacity \u003C TargetCapacity` | Fleet is below target — instances are being interrupted faster than replacements launch. |\n| ASG `CapacityRebalance: false` | Capacity rebalance is off. The ASG does not proactively replace at-risk instances. |\n| ASG `MixedInstancesPolicy` with 1 instance type | No diversification. High risk of simultaneous reclaim. |\n\n## Process — operation planning (apply in order)\n\n### Step 0: Expert knowledge - non-obvious EC2 Spot interruption behaviors (condensed)\n\n- The 2-minute warning is a maximum, not a guarantee - design the pipeline to finish within 90 seconds. EventBridge is the ONLY notification channel.\n- `InstanceInterruptionBehavior` is set at launch and immutable (terminate \u002F stop \u002F hibernate).\n- Capacity rebalance is proactive (launches replacements BEFORE the warning). Prefer `capacity-optimized` over `lowest-price` for production.\n- Diversification math: 3 families x 3 AZs = 9 pools for 99.9% availability. Spot placement score is a forecast, not a guarantee.\n- Spot Block is deprecated (2024+). ELB deregistration delay must fit within 2 minutes; lifecycle hooks fire on termination, not the warning.\n- Full deep dives (Graviton rates, StatusCode early warning, Fleet auto-replacement): [Advanced patterns](references\u002Fadvanced-patterns.md).\n\n### Step 1: Pre-check gate — REVIEW_REQUIRED if any check needs human attention\n\nRun ALL pre-checks for the chosen operation. If any check fails or\nrequires human review, the verdict is REVIEW_REQUIRED with the specific\nitems listed. Do NOT execute until the operator reviews.\n\n**For ALL operations:**\n1. Spot Instance Request exists and `State: active`.\n2. Instance is `running`.\n3. EventBridge interruption-warning rule is `ENABLED`.\n4. SQS queue (or Lambda target) is healthy — no consumer lag.\n\n**For handle-interruption (live EventBridge warning event):**\n5. Event `detail.instance-action` determines shutdown sequence\n   (`terminate`, `stop`, or `hibernate`).\n6. Instance registered to a target group. Lambda `Active` with\n   reserved concurrency >= 1, timeout >= 60. Checkpoint target exists.\n7. The 2-minute window has not already elapsed.\n\n**For configure-pipeline (set up EventBridge + SQS + Lambda):**\n5. EventBridge pattern matches `\"EC2 Spot Instance Interruption\n   Warning\"`. SQS queue has DLQ configured.\n6. Lambda timeout >= 60. Lambda role has `ec2:DescribeInstances`,\n   `elasticloadbalancing:DeregisterTargets`, `s3:PutObject`.\n7. Target group `deregistration_delay.timeout_seconds` is 30-60s.\n\n**For tune-replacement-strategy (modify Fleet or ASG):**\n5. Current `AllocationStrategy` identified. Proposed strategy is\n   `capacity-optimized` (recommended) or `diversified` with >= 3 pools.\n6. For ASGs: `CapacityRebalance` enabled. `ExcessCapacityTerminationPolicy`\n   reviewed (default `true`).\n\n**For audit-diversification (read-only):**\n5. Fleet\u002FASG `Overrides` lists all instance types and AZs.\n6. Count of unique instance families >= 3, unique AZs >= 3.\n   Graviton included (recommended).\n\n**For validate-placement-score (read-only):**\n5. `get-spot-placement-scores` called. Score >= 7 good, 4-6 marginal,\n   \u003C= 3 avoid.\n\n**For configure-checkpointing (stateful workload):**\n5. Checkpoint target exists. Application supports checkpoint signals\n   (SIGTERM handler). Checkpoint frequency configured. Restore path\n   tested.\n\n**For audit-pipeline-health (read-only):**\n5. EventBridge `ENABLED`. SQS `ApproximateAgeOfOldestMessage` \u003C 120s.\n   DLQ empty. Lambda `Active`, reserved concurrency >= 1. ELB delay\n   30-60s.\n\nInterruption-handling failure-mode table (Lambda never invoked, ELB still sending traffic, Fleet did not auto-replace, etc.): see [Error handling](references\u002Ferror-handling.md).\n\n### Step 2: OPERATION_COMPLETED or REVIEW_REQUIRED — emit operation plan\n\nIf all pre-checks pass AND the operation is read-only or low-risk\n(audit-diversification, validate-placement-score, audit-pipeline-health,\nhandle-interruption where the pipeline executes successfully), emit\n`VERDICT: OPERATION_COMPLETED` (for already-finished operations) or\nthe executable plan with the CONFIRM gate.\n\nFor operations requiring human review (tune-replacement-strategy changes\nthe allocation strategy, configure-pipeline on a production ASG, enabling\ncapacity rebalance, changing `InstanceInterruptionBehavior`), emit\n`VERDICT: REVIEW_REQUIRED` with the specific items to review. The plan\nincludes:\n\n- The exact AWS CLI command with all flags populated from the Spot\u002FFleet\u002F\n  ASG configuration.\n- The expected duration (Lambda execution 10-45 seconds; Spot Fleet\n  replacement launch 30 seconds to 3 minutes; ASG capacity rebalance\n  proactive replacement within minutes).\n- The expected side-effects (instance deregistered, replacement launched,\n  capacity restored, checkpoint written).\n- The CONFIRM gate prompt.\n- The monitoring step (CloudWatch metrics for `SpotInstanceInterruptionCount`,\n  ELB `HealthyHostCount`, Lambda errors).\n\n### Step 3: Execute behind CONFIRM gate\n\n- **MANDATORY CONFIRMATION GATE.** Before any state-changing CLI\n  (`modify-spot-fleet-request`, `deregister-targets`,\n  `update-function-configuration`, `put-rule`, `put-targets`,\n  `update-auto-scaling-group`, `put-lifecycle-hook`,\n  `terminate-instances`), emit: `CONFIRM: About to \u003Coperation> on\n  \u003Ctarget> in account \u003Caccount> region \u003Cregion>. This will\n  \u003Cconsequence>. Proceed? (yes\u002Fno)`. Do NOT execute until the operator\n  confirms.\n- Capture pre-state for audit: `aws ec2 describe-spot-instance-requests\n  --spot-instance-request-id \u003Cid> --output json > \u002Ftmp\u002F\u003Cid>-pre-$(date\n  +%s).json`.\n- For handle-interruption: the Lambda function is invoked by\n  EventBridge (or manually for testing). The Lambda deregisters the\n  instance from the ELB, writes a checkpoint, and signals the\n  application to shut down. Monitor via:\n  `aws logs tail \u002Faws\u002Flambda\u002F\u003Cfn> --follow --since 2m`.\n- For tune-replacement-strategy: execute the\n  `modify-spot-fleet-request` or `update-auto-scaling-group`. The\n  change is immediate — new launches use the new strategy. Existing\n  instances are not restarted.\n\n### Step 4: Post-verification — OPERATION_COMPLETED\n\nAfter the operation finishes, run post-verification. ALL checks must\npass for `OPERATION_COMPLETED`.\n\n1. For handle-interruption: confirm the instance was deregistered from\n   the ELB (`describe-target-health` shows `TargetHealth.State: unused`\n   or the target is gone), the checkpoint was written to S3 or\n   DynamoDB (verify the object or item exists with a recent\n   timestamp), and the replacement launched (Spot Fleet\n   `FulfilledCapacity` is back to `TargetCapacity`, or ASG\n   `DesiredCapacity` is met).\n2. For configure-pipeline: test the pipeline by emitting a synthetic\n   interruption event (`aws events put-events` with a test payload) and\n   confirm the Lambda executes successfully.\n3. For tune-replacement-strategy: confirm the\n   `AllocationStrategy` changed via `describe-spot-fleet-requests` or\n   `describe-auto-scaling-groups`. Monitor for the next 24 hours —\n   the interruption rate should decrease with `capacity-optimized`.\n4. For audit-diversification: report the count of unique instance\n   families and AZs. Flag if below the 3 x 3 minimum.\n5. For audit-pipeline-health: report the health of each component\n   (EventBridge, SQS, Lambda, ELB target group, ASG lifecycle hook).\n6. Application error rate: confirm the ELB `HTTPCode_ELB_5XX_Count`\n   and `TargetConnectionErrorCount` metrics did not spike during the\n   interruption handling window.\n7. Checkpoint integrity: for stateful workloads, verify the\n   replacement loaded the checkpoint and resumed from the correct\n   state.\n\nIf ANY verification fails, emit `VERDICT: ERROR` with the failure\ndetails — do not claim OPERATION_COMPLETED. A failed verification\ntypically means the pipeline is misconfigured (Lambda timeout, missing\npermissions, ELB delay too long) or the diversification is insufficient.\n\n## Output format (per operation)\n\n```text\nOPERATION: \u003Chandle-interruption | configure-pipeline | tune-replacement-strategy | audit-diversification | validate-placement-score | configure-checkpointing | audit-pipeline-health>\nVERDICT: OPERATION_COMPLETED | REVIEW_REQUIRED\nTARGET: \u003Cspot-instance-id-or-fleet-id-or-asg-name> (strategy: \u003Ccurrent>, target: \u003Ctarget-config>)\nPRE_CHECKS:\n  - [PASS] \u003Ccheck description>\n  - [REVIEW] \u003Ccheck description> — \u003Citem to review>\nSTEPS:\n  1. \u003CCLI command with flags populated>\n  2. \u003Cwait \u002F monitoring command>\n  3. \u003Cnext step>\nPOST_VERIFY:\n  - [PASS] \u003Cverification description>\n  - [FAIL] \u003Cverification description> — \u003Creason>\nNOTES: \u003Cmonitoring, caveats, diversification recommendation>\n```\n\n### Worked example — handle-interruption (OPERATION_COMPLETED)\n\n```text\nOPERATION: handle-interruption\nVERDICT: OPERATION_COMPLETED\nTARGET: i-0abc123def456 (Spot Fleet: sfr-abc123, ASG: prod-web-asg)\nPRE_CHECKS:\n  - [PASS] EventBridge warning received: instance-action=terminate,\n    event time 2026-08-11T14:23:00Z (105 seconds remaining in window)\n  - [PASS] Instance i-0abc123def456 registered to target group\n    arn:aws:elasticloadbalancing:us-east-1:111111111111:targetgroup\u002Fprod-web-tg\u002F...\n  - [PASS] Graceful-shutdown Lambda prod-spot-shutdown State: Active,\n    Timeout: 90, ReservedConcurrentExecutions: 10\n  - [PASS] Lambda execution role has elasticloadbalancing:DeregisterTargets,\n    s3:PutObject on arn:aws:s3:::prod-checkpoints\u002F*\n  - [PASS] ELB deregistration_delay.timeout_seconds: 45 (fits within\n    the 2-minute window)\n  - [PASS] ASG InstanceTerminating lifecycle hook HeartbeatTimeout: 120\nSTEPS:\n  1. Lambda prod-spot-shutdown invoked by EventBridge at 14:23:01Z.\n  2. Lambda deregistered i-0abc123def456 from target group\n     (deregistration draining started at 14:23:03Z).\n  3. Lambda sent SIGTERM to the application process (via SSM\n     SendCommand) — application flushed in-flight requests and wrote\n     checkpoint to s3:\u002F\u002Fprod-checkpoints\u002Fi-0abc123def456\u002Fstate.json\n     (completed 14:23:38Z).\n  4. ELB target entered \"unused\" state at 14:23:48Z (45s drain).\n  5. Instance terminated by Spot service at 14:25:00Z.\n  6. ASG launched replacement i-0new456 (capacity-optimized, m6a.large\n     in us-east-1b) at 14:25:15Z. Replacement \"running\" at 14:27:45Z.\n  7. Replacement registered to target group, health checks passing at\n     14:28:30Z.\nPOST_VERIFY:\n  - [PASS] i-0abc123def456 deregistered from target group\n  - [PASS] Checkpoint written: s3:\u002F\u002Fprod-checkpoints\u002Fi-0abc123def456\u002Fstate.json\n    (timestamp 2026-08-11T14:23:38Z)\n  - [PASS] Spot Fleet FulfilledCapacity: 10 (matches TargetCapacity)\n  - [PASS] Replacement i-0new456 TargetHealth.State: healthy\n  - [PASS] ELB HTTPCode_ELB_5XX_Count: no spike during the window\n  - [PASS] Application resumed from checkpoint on replacement\nNOTES:\n  - Total handling time: 35 seconds (deregister + checkpoint + flush).\n    Well within the 2-minute window.\n  - Spot Fleet auto-replaced the interrupted instance via the\n    capacity-optimized allocation strategy. Replacement launched in\n    us-east-1b (different AZ from the interrupted instance, which was\n    in us-east-1a).\n  - The ASG CapacityRebalance was enabled — a proactive replacement\n    was already in progress when the interruption warning fired,\n    reducing the effective gap to zero.\n```\n\n## Anti-Patterns — NEVER\n\n- NEVER rely on Spot without a graceful-shutdown pipeline. Without\n  EventBridge + a consumer, the instance is terminated with no warning.\n  The 2-minute warning is the ONLY notification channel.\n\n- NEVER set the ELB deregistration delay longer than the 2-minute\n  window. The default ALB delay of 300 seconds means the instance is\n  terminated before draining finishes. Set to 30-60 seconds for Spot.\n\n- NEVER use `lowest-price` with a single pool for production. Use\n  `capacity-optimized` with 3+ families across 3+ AZs. The 5-8% cost\n  premium is offset by the 5-10x reduction in interruptions.\n\n- NEVER assume the 2-minute warning is always exactly 120 seconds.\n  Design the pipeline to complete within 90 seconds.\n\n- NEVER change `InstanceInterruptionBehavior` on a running instance —\n  it is set at launch and immutable.\n\n- NEVER forget the Lambda resource-based policy for EventBridge\n  (`events.amazonaws.com`). Without it, direct Lambda invocation fails\n  silently.\n\n- NEVER use Spot Block for new capacity — it is deprecated (2024+).\n  Use On-Demand Capacity Reservations for predictable capacity.\n\n- NEVER rely on hibernate as the only state-preservation. Hibernate\n  saves memory to EBS but EC2 may terminate the instance afterward.\n  Use application-level checkpointing to S3 or DynamoDB.\n\n- NEVER ignore SQS queue depth. Messages older than 120 seconds are\n  stale — the instance is already terminated. Set a CloudWatch alarm.\n\n- NEVER diversify across instance types within a single family only.\n  `c5.large`, `c5.xlarge`, `c5.2xlarge` share the same pools. Mix\n  families (`c5`, `m5`, `c6g`) for true independence.\n\n- NEVER assume Spot Fleet auto-replacement restores state. Replacements\n  start from scratch — stateful workloads must checkpoint independently.\n\n- NEVER auto-execute a state-changing Spot CLI without the CONFIRM gate.\n  Allocation strategy, target capacity, and interruption behavior\n  changes affect billing and availability.\n\n- NEVER assume capacity rebalance eliminates all interruptions. It is\n  proactive but cannot prevent every reclaim. The graceful-shutdown\n  pipeline is still required.\n\n- NEVER forget to test the pipeline with a synthetic event. The first\n  real interruption is NOT the time to discover the pipeline is broken.\n\n## Pre-flight safety checks (run before any remediation CLI)\n\n- **MANDATORY CONFIRMATION GATE.** Before any state-changing operation\n  (`modify-spot-fleet-request`, `update-auto-scaling-group`,\n  `put-lifecycle-hook`, `modify-target-group-attributes`,\n  `terminate-instances`, `deregister-targets`,\n  `update-function-configuration`, `put-rule`, `put-targets`),\n  emit: `CONFIRM: About to \u003Coperation> on \u003Ctarget> in account\n  \u003Caccount> region \u003Cregion>. This will \u003Cconsequence>. Proceed?\n  (yes\u002Fno)`.\n\n- **Capture pre-state for audit.** `describe-spot-fleet-requests` or\n  `describe-auto-scaling-groups` JSON saved to `\u002Ftmp\u002F\u003Cid>-pre-$(date\n  +%s).json`.\n\n- **Verify pipeline health.** EventBridge rule `ENABLED`. SQS queue\n  depth stable, oldest message under 120s, DLQ configured. Lambda\n  `State: Active`, `Timeout >= 60`, reserved concurrency not 0. ELB\n  `deregistration_delay.timeout_seconds` 30-60s for Spot targets. ASG\n  lifecycle hook `HeartbeatTimeout >= 120`.\n\n- **Verify diversification.** At least 3 instance families across 3\n  AZs. Use `capacity-optimized` allocation strategy. Enable\n  `CapacityRebalance` on ASGs for proactive replacement.\n\n## References (load on demand)\n\n- [Worked examples](references\u002Fworked-examples.md) - tune-replacement-strategy (REVIEW_REQUIRED) and configure-pipeline walkthroughs\n- [Error handling](references\u002Ferror-handling.md) - failure-mode table and malformed-input VERDICT: ERROR protocol\n- [Diagnostic commands](references\u002Fdiagnostic-commands.md) - live-account pre-flight command listing\n- [Advanced patterns](references\u002Fadvanced-patterns.md) - expert behaviors and 2024-2026 feature notes\n- [Diversification and strategy](references\u002Fdiversification-and-strategy.md) - allocation strategies, diversification math, placement score\n- [Graceful shutdown pipeline](references\u002Fgraceful-shutdown-pipeline.md) - EventBridge + SQS + Lambda architecture and checkpointing\n\n## Domain\n\nAWS CloudOps \u002F EC2 Spot Instance Interruption Handling, Graceful\nShutdown & Capacity Resilience.\n\n## AWS documentation\n\n- **Amazon EC2 Spot Instances** — https:\u002F\u002Fdocs.aws.amazon.com\u002FAWSEC2\u002Flatest\u002FUserGuide\u002Fusing-spot-instances.html\n- **Spot Instance interruption notices** — https:\u002F\u002Fdocs.aws.amazon.com\u002FAWSEC2\u002Flatest\u002FUserGuide\u002Fspot-interruptions.html\n- **Best practices for Spot Instances** — https:\u002F\u002Fdocs.aws.amazon.com\u002FAWSEC2\u002Flatest\u002FUserGuide\u002Fspot-best-practices.html\n- **Spot Fleet** — https:\u002F\u002Fdocs.aws.amazon.com\u002FAWSEC2\u002Flatest\u002FUserGuide\u002Fspot-fleet.html\n- **Capacity Rebalance** — https:\u002F\u002Fdocs.aws.amazon.com\u002Fautoscaling\u002Fec2\u002Fuserguide\u002Fcapacity-rebalance.html\n- **Spot Instance interruption handling** — https:\u002F\u002Fdocs.aws.amazon.com\u002FAWSEC2\u002Flatest\u002FUserGuide\u002Fhandling-spot-interruptions.html\n- **Spot Placement Score** — https:\u002F\u002Fdocs.aws.amazon.com\u002FAWSEC2\u002Flatest\u002FAPIReference\u002FAPI_GetSpotPlacementScores.html\n- **EventBridge EC2 Spot Instance Interruption Warning** — https:\u002F\u002Fdocs.aws.amazon.com\u002Feventbridge\u002Flatest\u002Fuserguide\u002Feb-service-event.html#eb-spot-instance\n- **Auto Scaling lifecycle hooks** — https:\u002F\u002Fdocs.aws.amazon.com\u002Fautoscaling\u002Fec2\u002Fuserguide\u002Flifecycle-hooks.html\n- **ELB target group deregistration delay** — https:\u002F\u002Fdocs.aws.amazon.com\u002Felasticloadbalancing\u002Flatest\u002Fapplication\u002Fload-balancer-target-groups.html#deregistration-delay\n",{"name":5,"license":15,"metadata":24,"description":7,"compatibility":42},{"tags":25,"phase":26,"author":27,"domain":28,"family":29,"version":30,"keywords":31,"task_type":32,"complexity":33,"entry_point":34,"skill_class":35,"when_to_use":36,"requires_llm":37,"verdict_shape":38,"lifecycle_status":39,"invocation_schema":40,"supports_pipeline":37,"activation_triggers":41},"aws, ec2, spot, compute, interruption, autoscaling, eventbridge, operate","4","Jacky Chan — AWS Community Builder","aws-cloudops","Compute","0.1.0","Spot Instance, Spot interruption, 2-minute warning, Instance Interruption Warning, EventBridge Spot, SQS interruption queue, graceful shutdown, drain from ELB, checkpoint state, capacity rebalance, capacity-optimized, diversified allocation, Spot Fleet, ASG capacity rebalance, stateful checkpointing, Spot placement score, instance diversification, hibernate on interruption, Spot Block deprecation, Spot two-minute warning","operate","high","false","capability","Handling a live Spot Instance Interruption Warning (the 2-minute notice), configuring an EventBridge rule plus SQS queue plus Lambda pipeline for graceful shutdown, tuning a Spot Fleet or ASG for capacity rebalance and auto-replacement, selecting a replacement strategy (capacity-optimized, diversified, lowest-price), validating Spot placement score before a launch, auditing instance diversification across families and AZs (target: minimum 3 instance families for 99.9% availability), configuring stateful workload checkpointing to S3 or DynamoDB, or auditing the interruption-handling pipeline health.","true","OPERATION_COMPLETED | REVIEW_REQUIRED","active","Input: either (a) a Spot Instance or Spot Fleet configuration (describe-spot-instance-requests, describe-spot-fleet-requests, or describe-auto-scaling-groups output) plus the intended operation (handle-interruption, configure-pipeline, tune-replacement-strategy, audit-diversification, validate-placement-score, configure-checkpointing, audit-pipeline-health), OR (b) an EventBridge Instance Interruption Warning event for live handling. Output: deterministic OPERATION \u002F VERDICT \u002F PRE_CHECKS \u002F STEPS \u002F POST_VERIFY \u002F NOTES block per operation, where VERDICT is OPERATION_COMPLETED or REVIEW_REQUIRED.","Spot interruption warning, Spot Instance interrupted, 2-minute warning Spot, graceful shutdown Spot, drain Spot from ELB, checkpoint Spot instance, capacity rebalance Spot, Spot Fleet replacement, ASG capacity rebalance, Spot placement score, instance diversification Spot, Spot Block deprecation, hibernate Spot instance, Spot graceful shutdown pipeline, Spot interruption queue","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-spot-instance-requests, describe-spot-fleet- requests, describe-instances, modify-spot-fleet-request, aws events put-rule, put-targets, aws sqs receive-message, delete-message, get-queue-attributes, aws lambda get-function-configuration, invoke, aws autoscaling describe-auto-scaling-groups, put-lifecycle-hook, aws...","main","eeace51bd5dd1db2030729d83eeab988861553aa","skills\u002Fec2-spot-interruption-operator",0,"https:\u002F\u002Fgithub.com\u002Fjhkchan\u002Faws-agent-skills","https:\u002F\u002Fgithub.com\u002Fjhkchan","CTO & Co-Founder @Beever-AI  & @votee. CAISP. AWS Community Builder. Organizer@GDGCloudHK. MongoDB Champion. Technopreneur + Infornographer.","2026-09-24 08:54:10",{"source":8,"skillName":5,"commands":52,"prompt":62,"zipAvailable":63},[53,56,59],{"tool":54,"command":55},"npx","npx skills add jhkchan\u002Faws-agent-skills --skill ec2-spot-interruption-operator",{"tool":57,"command":58},"bunx","bunx skills add jhkchan\u002Faws-agent-skills --skill ec2-spot-interruption-operator",{"tool":60,"command":61},"pnpm","pnpm dlx skills add jhkchan\u002Faws-agent-skills --skill ec2-spot-interruption-operator","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fjhkchan\u002Faws-agent-skills\u002Fblob\u002Fmain\u002Fskills\u002Fec2-spot-interruption-operator\u002FSKILL.md",true,[65,71,75,79,83,87,91,95,99,103,107,111,115,119,123,127,131,135,139,143,147],{"path":66,"resourceType":67,"resourceTypeDesc":68,"sizeBytes":69,"sourceHtmlUrl":70},"eval\u002Ftest-cases.yaml","REFERENCE","参考文档",8954,"https:\u002F\u002Fgithub.com\u002Fjhkchan\u002Faws-agent-skills\u002Fblob\u002Fmain\u002Fskills\u002Fec2-spot-interruption-operator\u002Feval\u002Ftest-cases.yaml",{"path":72,"resourceType":67,"resourceTypeDesc":68,"sizeBytes":73,"sourceHtmlUrl":74},"evals\u002Fbaselines\u002Faudit-diversification-single-pool-review-required.md",855,"https:\u002F\u002Fgithub.com\u002Fjhkchan\u002Faws-agent-skills\u002Fblob\u002Fmain\u002Fskills\u002Fec2-spot-interruption-operator\u002Fevals\u002Fbaselines\u002Faudit-diversification-single-pool-review-required.md",{"path":76,"resourceType":67,"resourceTypeDesc":68,"sizeBytes":77,"sourceHtmlUrl":78},"evals\u002Fbaselines\u002Fhandle-interruption-graceful-shutdown-completed.md",851,"https:\u002F\u002Fgithub.com\u002Fjhkchan\u002Faws-agent-skills\u002Fblob\u002Fmain\u002Fskills\u002Fec2-spot-interruption-operator\u002Fevals\u002Fbaselines\u002Fhandle-interruption-graceful-shutdown-completed.md",{"path":80,"resourceType":67,"resourceTypeDesc":68,"sizeBytes":81,"sourceHtmlUrl":82},"evals\u002Fbaselines\u002Flambda-reserved-concurrency-zero-review-required.md",712,"https:\u002F\u002Fgithub.com\u002Fjhkchan\u002Faws-agent-skills\u002Fblob\u002Fmain\u002Fskills\u002Fec2-spot-interruption-operator\u002Fevals\u002Fbaselines\u002Flambda-reserved-concurrency-zero-review-required.md",{"path":84,"resourceType":67,"resourceTypeDesc":68,"sizeBytes":85,"sourceHtmlUrl":86},"evals\u002Fbaselines\u002Ftune-strategy-lowest-price-review-required.md",1335,"https:\u002F\u002Fgithub.com\u002Fjhkchan\u002Faws-agent-skills\u002Fblob\u002Fmain\u002Fskills\u002Fec2-spot-interruption-operator\u002Fevals\u002Fbaselines\u002Ftune-strategy-lowest-price-review-required.md",{"path":88,"resourceType":67,"resourceTypeDesc":68,"sizeBytes":89,"sourceHtmlUrl":90},"evals\u002Fbaselines\u002Fvalidate-placement-score-good-completed.md",640,"https:\u002F\u002Fgithub.com\u002Fjhkchan\u002Faws-agent-skills\u002Fblob\u002Fmain\u002Fskills\u002Fec2-spot-interruption-operator\u002Fevals\u002Fbaselines\u002Fvalidate-placement-score-good-completed.md",{"path":92,"resourceType":67,"resourceTypeDesc":68,"sizeBytes":93,"sourceHtmlUrl":94},"evals\u002Feval_config.yaml",2098,"https:\u002F\u002Fgithub.com\u002Fjhkchan\u002Faws-agent-skills\u002Fblob\u002Fmain\u002Fskills\u002Fec2-spot-interruption-operator\u002Fevals\u002Feval_config.yaml",{"path":96,"resourceType":67,"resourceTypeDesc":68,"sizeBytes":97,"sourceHtmlUrl":98},"evals\u002Fevals.json",4760,"https:\u002F\u002Fgithub.com\u002Fjhkchan\u002Faws-agent-skills\u002Fblob\u002Fmain\u002Fskills\u002Fec2-spot-interruption-operator\u002Fevals\u002Fevals.json",{"path":100,"resourceType":67,"resourceTypeDesc":68,"sizeBytes":101,"sourceHtmlUrl":102},"evals\u002Fprompts\u002Faudit-diversification-single-pool-review-required.md",1150,"https:\u002F\u002Fgithub.com\u002Fjhkchan\u002Faws-agent-skills\u002Fblob\u002Fmain\u002Fskills\u002Fec2-spot-interruption-operator\u002Fevals\u002Fprompts\u002Faudit-diversification-single-pool-review-required.md",{"path":104,"resourceType":67,"resourceTypeDesc":68,"sizeBytes":105,"sourceHtmlUrl":106},"evals\u002Fprompts\u002Fhandle-interruption-graceful-shutdown-completed.md",1676,"https:\u002F\u002Fgithub.com\u002Fjhkchan\u002Faws-agent-skills\u002Fblob\u002Fmain\u002Fskills\u002Fec2-spot-interruption-operator\u002Fevals\u002Fprompts\u002Fhandle-interruption-graceful-shutdown-completed.md",{"path":108,"resourceType":67,"resourceTypeDesc":68,"sizeBytes":109,"sourceHtmlUrl":110},"evals\u002Fprompts\u002Flambda-reserved-concurrency-zero-review-required.md",1126,"https:\u002F\u002Fgithub.com\u002Fjhkchan\u002Faws-agent-skills\u002Fblob\u002Fmain\u002Fskills\u002Fec2-spot-interruption-operator\u002Fevals\u002Fprompts\u002Flambda-reserved-concurrency-zero-review-required.md",{"path":112,"resourceType":67,"resourceTypeDesc":68,"sizeBytes":113,"sourceHtmlUrl":114},"evals\u002Fprompts\u002Ftune-strategy-lowest-price-review-required.md",884,"https:\u002F\u002Fgithub.com\u002Fjhkchan\u002Faws-agent-skills\u002Fblob\u002Fmain\u002Fskills\u002Fec2-spot-interruption-operator\u002Fevals\u002Fprompts\u002Ftune-strategy-lowest-price-review-required.md",{"path":116,"resourceType":67,"resourceTypeDesc":68,"sizeBytes":117,"sourceHtmlUrl":118},"evals\u002Fprompts\u002Fvalidate-placement-score-good-completed.md",1034,"https:\u002F\u002Fgithub.com\u002Fjhkchan\u002Faws-agent-skills\u002Fblob\u002Fmain\u002Fskills\u002Fec2-spot-interruption-operator\u002Fevals\u002Fprompts\u002Fvalidate-placement-score-good-completed.md",{"path":120,"resourceType":67,"resourceTypeDesc":68,"sizeBytes":121,"sourceHtmlUrl":122},"examples\u002FREADME.md",9867,"https:\u002F\u002Fgithub.com\u002Fjhkchan\u002Faws-agent-skills\u002Fblob\u002Fmain\u002Fskills\u002Fec2-spot-interruption-operator\u002Fexamples\u002FREADME.md",{"path":124,"resourceType":67,"resourceTypeDesc":68,"sizeBytes":125,"sourceHtmlUrl":126},"references\u002Fadvanced-patterns.md",4313,"https:\u002F\u002Fgithub.com\u002Fjhkchan\u002Faws-agent-skills\u002Fblob\u002Fmain\u002Fskills\u002Fec2-spot-interruption-operator\u002Freferences\u002Fadvanced-patterns.md",{"path":128,"resourceType":67,"resourceTypeDesc":68,"sizeBytes":129,"sourceHtmlUrl":130},"references\u002Fdiagnostic-commands.md",1446,"https:\u002F\u002Fgithub.com\u002Fjhkchan\u002Faws-agent-skills\u002Fblob\u002Fmain\u002Fskills\u002Fec2-spot-interruption-operator\u002Freferences\u002Fdiagnostic-commands.md",{"path":132,"resourceType":67,"resourceTypeDesc":68,"sizeBytes":133,"sourceHtmlUrl":134},"references\u002Fdiversification-and-strategy.md",9121,"https:\u002F\u002Fgithub.com\u002Fjhkchan\u002Faws-agent-skills\u002Fblob\u002Fmain\u002Fskills\u002Fec2-spot-interruption-operator\u002Freferences\u002Fdiversification-and-strategy.md",{"path":136,"resourceType":67,"resourceTypeDesc":68,"sizeBytes":137,"sourceHtmlUrl":138},"references\u002Ferror-handling.md",2306,"https:\u002F\u002Fgithub.com\u002Fjhkchan\u002Faws-agent-skills\u002Fblob\u002Fmain\u002Fskills\u002Fec2-spot-interruption-operator\u002Freferences\u002Ferror-handling.md",{"path":140,"resourceType":67,"resourceTypeDesc":68,"sizeBytes":141,"sourceHtmlUrl":142},"references\u002Fgraceful-shutdown-pipeline.md",13190,"https:\u002F\u002Fgithub.com\u002Fjhkchan\u002Faws-agent-skills\u002Fblob\u002Fmain\u002Fskills\u002Fec2-spot-interruption-operator\u002Freferences\u002Fgraceful-shutdown-pipeline.md",{"path":144,"resourceType":67,"resourceTypeDesc":68,"sizeBytes":145,"sourceHtmlUrl":146},"references\u002Fworked-examples.md",6606,"https:\u002F\u002Fgithub.com\u002Fjhkchan\u002Faws-agent-skills\u002Fblob\u002Fmain\u002Fskills\u002Fec2-spot-interruption-operator\u002Freferences\u002Fworked-examples.md",{"path":148,"resourceType":67,"resourceTypeDesc":68,"sizeBytes":149,"sourceHtmlUrl":150},"skill.usf.yaml",4723,"https:\u002F\u002Fgithub.com\u002Fjhkchan\u002Faws-agent-skills\u002Fblob\u002Fmain\u002Fskills\u002Fec2-spot-interruption-operator\u002Fskill.usf.yaml",[152,159,166,173,180,187],{"skillNo":153,"name":154,"nameZh":6,"description":155,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":156,"categories":157,"keywords":158,"publishedAt":19},"01M7ADVD60X4PCAPKSE58P9NDC","xray-tracing-deployer","Deploys AWS X-Ray distributed tracing with production-grade configuration: X-Ray daemon deployment (EC2 systemd, ECS sidecar, EKS DaemonSet, Lambda built-in), SDK instrumentation (Java, Python, Node.js, Go, .NET) with annotations and metadata, sampling rules (default reservoir + rate vs custom rules with URL \u002F method \u002F service-name predicates), service map generation, trace query and retrieval, groups and insights, CloudWatch ServiceLens integration, IAM permissions (PutTraceSegments, GetSamplingRules), and latest features (Lambda Powertools tracing, OpenTelemetry \u002F ADOT Collector support, W3C trace context). Emits a READY_TO_DEPLOY checklist with every configuration item verified. Use when enabling X-Ray on a new application, adding tracing to ECS \u002F EKS \u002F Lambda, validating a sampling configuration, or generating daemon deployment CLI and IaC templates. Triggers: X-Ray, distributed tracing, X-Ray daemon, sampling rules, service map, X-Ray SDK, OpenTelemetry, ADOT, Lambda Powertools, CloudWatch ServiceLens.","https:\u002F\u002Fgithub.com\u002Fjhkchan\u002Faws-agent-skills\u002Fblob\u002Fmain\u002Fskills\u002Fxray-tracing-deployer\u002FSKILL.md",[],[],{"skillNo":160,"name":161,"nameZh":6,"description":162,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":163,"categories":164,"keywords":165,"publishedAt":19},"01M7ADTVJ7DCBM9CB1FY51GH7J","wellarchitected-workload-auditor","Audits AWS Well-Architected Tool workloads for review staleness, per-pillar high-risk issue counts, milestone tracking gaps, and remediation plan completeness. Emits a deterministic verdict (STALE_REVIEW | HIGH_RISK | CONFIG_GAP | OK) per workload with per-pillar risk breakdown, milestone trend analysis, and specific remediation. Use when reviewing Well-Architected workloads, checking WA review freshness, auditing high-risk issues per pillar, validating milestone coverage, or tracking remediation plans.","https:\u002F\u002Fgithub.com\u002Fjhkchan\u002Faws-agent-skills\u002Fblob\u002Fmain\u002Fskills\u002Fwellarchitected-workload-auditor\u002FSKILL.md",[],[],{"skillNo":167,"name":168,"nameZh":6,"description":169,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":170,"categories":171,"keywords":172,"publishedAt":19},"01M7ADT59G6FTTNZYHT2QRPNNP","wellarchitected-review-operator","Operates AWS Well-Architected Tool reviews end-to-end — creates workloads, runs pillar reviews (operational excellence, security, reliability, performance, cost optimization, sustainability, Prosperity), answers questions with risk-tier rationale, generates reports and improvement plans, creates milestones, and integrates with Trusted Advisor and Well-Architected Labs. Runs deterministic pre-checks (workload existence, lens availability, pillar coverage), emits the exact update-answer \u002F get-consolidated-report CLI behind a CONFIRM gate, and verifies risk-tier transitions. Emits READY | BLOCKED | COMPLETED. Use when creating a workload, answering pillar questions, generating an improvement plan, creating a milestone, or integrating with Trusted Advisor. Triggers: well-architected tool, well architected review, workload review, pillar, operational excellence, security, reliability, performance, cost optimization, sustainability, prosperity, improvement plan, milestone, trusted advisor.","https:\u002F\u002Fgithub.com\u002Fjhkchan\u002Faws-agent-skills\u002Fblob\u002Fmain\u002Fskills\u002Fwellarchitected-review-operator\u002FSKILL.md",[],[],{"skillNo":174,"name":175,"nameZh":6,"description":176,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":177,"categories":178,"keywords":179,"publishedAt":19},"01M7ADSH5JA9QHNPPHQCD7EVA7","wafv2-web-acl-deployer","Provisions AWS WAFv2 Web ACLs with correct production defaults: scope selection (CLOUDFRONT vs REGIONAL), managed rule groups (AWSManagedRulesCommonRuleSet, SQLiRuleSet, LinuxRuleSet, WindowsRuleSet, IPReputationList, BotControlRuleSet, AmazonIpReputationList, ATP), custom rules (byte match, IP set, regex pattern, geo match, size constraint, rate-based), rule priority ordering, logging destinations (Kinesis Firehose, CloudWatch Logs, S3), resource association (ALB, API Gateway, CloudFront), rate-based rules with aggregate keys (IP, forwarded IP), Challenge and CAPTCHA actions, and account takeover prevention. Emits a READY_TO_DEPLOY checklist. Use when creating a Web ACL, attaching managed rules, configuring rate limiting, enabling WAF logging, associating a Web ACL with an ALB\u002FAPI Gateway\u002FCloudFront, or configuring CAPTCHA\u002FChallenge actions. Triggers: create WAF Web ACL, WAFv2, managed rule groups, WAF rate limiting, WAF logging, WAF CAPTCHA, WAF Challenge action, bot control, ATP managed rules.","https:\u002F\u002Fgithub.com\u002Fjhkchan\u002Faws-agent-skills\u002Fblob\u002Fmain\u002Fskills\u002Fwafv2-web-acl-deployer\u002FSKILL.md",[],[],{"skillNo":181,"name":182,"nameZh":6,"description":183,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":184,"categories":185,"keywords":186,"publishedAt":19},"01M7ADRYFAT8R73FBNCHRC573X","wafv2-web-acl-auditor","Audits AWS WAFv2 Web ACL configurations to determine whether the ACL provides effective protection: default-action posture (Allow vs Block), managed-rule-group coverage gaps, rule effectiveness (BLOCK vs COUNT, shadow\u002Fbypass rules, stale exclusions), rate-based rule correctness, logging and visibility configuration, and text-transformation bypass vectors. Emits a deterministic verdict per Web ACL. Use when reviewing a WAFv2 Web ACL for security posture, checking managed-rule coverage, validating rate-limit configuration, auditing WAF logging, or hardening a WAF before production deployment. Triggers: WAF, WAFv2, Web ACL, managed rule group, AWSManagedRules, rate-based rule, CAPTCHA, Challenge, OverrideAction, Count mode, forwarded IP, Bot Control, ATP, text transformation, WAF logging, WAF visibility, OWASP, SQLi, XSS, RFI.","https:\u002F\u002Fgithub.com\u002Fjhkchan\u002Faws-agent-skills\u002Fblob\u002Fmain\u002Fskills\u002Fwafv2-web-acl-auditor\u002FSKILL.md",[],[],{"skillNo":188,"name":189,"nameZh":6,"description":190,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":191,"categories":192,"keywords":193,"publishedAt":19},"01M7ADR8W7G72JX4KFGN03QK8Q","waf-rule-deployer","Provisions AWS WAFv2 rule sets with production defaults: Web ACL creation (CloudFront scope in us-east-1 vs Regional scope), rule groups (managed vs custom) with capacity planning in WCU (Web ACL Capacity Units, 1500 default per ACL), managed rule groups (AWSManagedRulesCommonRuleSet, AWSManagedRulesSQLiRuleSet, AWSManagedRulesAmazonIpReputationList, AWSManagedRulesLinuxRuleSet, AWSManagedRulesWindowsRuleSet, AWSManagedRulesUnixRuleSet), custom rules (byte-match, regex pattern set, geo-match, rate-based), IP set and regex pattern set resources, rule priority ordering (lowest number evaluated first), action types (allow, block, count, CAPTCHA, Challenge), bot control managed rule group, account takeover. Triggers: create WAF rule, WAF managed rule group, WAF custom rule, WAF byte match, WAF geo match, WAF rate based rule, WAF IP set, WAF regex pattern set, WAF WCU budget, WAF CloudFront ACL, WAF logging Kinesis Firehose, WAF bot control, WAF ATP, WAF label matching, WAF Challenge action, WAF CAPTCHA.","https:\u002F\u002Fgithub.com\u002Fjhkchan\u002Faws-agent-skills\u002Fblob\u002Fmain\u002Fskills\u002Fwaf-rule-deployer\u002FSKILL.md",[],[]]