[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M7A3RQ1GTZEX3Q24PCR6X361":3,"skill-same:01M7A3RQ1GTZEX3Q24PCR6X361":135},{"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":40,"commitSha":41,"skillDirectory":42,"forksCount":43,"repositoryHtmlUrl":44,"repositoryHomepageUrl":6,"ownerHtmlUrl":45,"ownerBlogUrl":6,"ownerDescription":46,"updatedAt":47,"install":48,"resources":61},"01M7A3RQ1GTZEX3Q24PCR6X361","autoscaling-group-auditor",null,"Audits AWS Auto Scaling Groups for launch-template health (legacy launch configuration, IMDSv2), ELB health-check integrity (missing target group, grace-period timing), mixed-instances policy (single Spot instance type, allocation strategy), capacity bounds (desired vs min\u002Fmax), and unhealthy termination behavior (EC2-only checks behind an ELB, capacity rebalance). Emits a deterministic verdict (MISCONFIGURED | CONFIG_GAP | OK) per ASG with enumerated findings and specific remediation. Use when reviewing ASG configurations, checking launch-template wiring, validating ELB health checks, auditing Spot diversification, or hardening capacity posture.","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\u002Fautoscaling-group-auditor\u002FSKILL.md",[],[],"2026-11-15 14:19:17",false,"---\nname: autoscaling-group-auditor\ndescription: Audits AWS Auto Scaling Groups for launch-template health (legacy launch configuration, IMDSv2), ELB health-check integrity (missing target group, grace-period timing), mixed-instances policy (single Spot instance type, allocation strategy), capacity bounds (desired vs min\u002Fmax), and unhealthy termination behavior (EC2-only checks behind an ELB, capacity rebalance). Emits a deterministic verdict (MISCONFIGURED | CONFIG_GAP | OK) per ASG with enumerated findings and specific remediation. Use when reviewing ASG configurations, checking launch-template wiring, validating ELB health checks, auditing Spot diversification, or hardening capacity posture.\nlicense: Apache-2.0\ncompatibility: Agent runtime that reads SKILL.md (Claude Code, Cursor, Windsurf, Codex, Gemini). No AWS CLI required for offline ASG-config classification. Live-account audits use aws autoscaling describe-auto-scaling-groups, aws ec2 describe-launch-templates, and aws elbv2 describe-target-groups (AWS CLI v2, SSO or key-based credentials).\nmetadata:\n  domain: aws-cloudops\n  complexity: high\n  requires_llm: 'true'\n  phase: '2'\n  supports_pipeline: 'true'\n  entry_point: 'false'\n  family: Compute\n  verdict_shape: MISCONFIGURED | CONFIG_GAP | OK\n  when_to_use: Reviewing an ASG configuration before production deployment, checking launch-template or launch-configuration wiring, validating ELB health checks and grace-period timing, auditing Spot instance diversification, verifying capacity bounds, or investigating unhealthy-instance replacement loops.\n  activation_triggers: audit this auto scaling group, check ASG health check, is my ASG misconfigured, launch template vs launch configuration, ELB health check no target group, spot single instance type, ASG capacity bounds, health check grace period too short, capacity rebalance spot, ASG infinite replacement loop\n  invocation_schema: 'Input: either (a) an ASG configuration (launch template\u002Fconfig, capacity bounds, health check settings, mixed-instances policy, AZs), optionally paired with launch-template metadata, OR (b) an ASG name\u002FARN for live-account audit. Output: deterministic ASG\u002FVERDICT\u002FREASON\u002FFINDINGS\u002F REMEDIATION block per group, where VERDICT is MISCONFIGURED, CONFIG_GAP, OK, or ERROR.'\n  version: 0.1.0\n  author: Jacky Chan — AWS Community Builder\n  keywords: Auto Scaling, ASG, launch template, launch configuration, ELB health check, target group, mixed instances, Spot, capacity, unhealthy termination, IMDSv2, CapacityRebalance, HealthCheckGracePeriod, SpotAllocationStrategy, OnDemandPercentageAboveBaseCapacity, TerminationPolicies, AvailabilityZones, fleet split, ASG audit, auto scaling remediation\n  tags: autoscaling, compute, launch-template, elb-health, spot, capacity, mixed-instances, audit\n---\n\n# Auto Scaling Group Auditor\n\n## Mindset\n\n**One-line takeaway:** the verdict is always the **worst** finding across all\ndimensions, and three ASG misconfigurations are silent killers —\nHealthCheckType=ELB with no target group (infinite replacement loop),\nlaunch-configuration usage (locked out of IMDSv2 and mixed-instances), and a\nsingle Spot instance type (one interruption takes down everything).\n\nAn Auto Scaling Group is the elasticity engine of EC2 workloads. Its\nconfiguration sits at the intersection of launch infrastructure (templates,\nAMIs, IMDSv2), health detection (ELB vs EC2 checks, grace periods), capacity\nplanning (min\u002Fmax\u002Fdesired bounds, Spot diversification), and failure recovery\n(termination policies, capacity rebalance). A misconfiguration in any\ndimension produces silent degradation — the ASG keeps running but instances\ncycle, apps hang undetected, or Spot interruptions cascade.\n\n- **ELB health check with no target group** is a **silent infinite loop**: the\n  ASG launches, the ELB never reports health, the ASG terminates and relaunches\n  — indefinitely. It looks like \"high churn,\" not an obvious error.\n- **Launch configuration** is a **technical-debt dead end**: deprecated for new\n  creation (Dec 2023), incompatible with MixedInstancesPolicy, and cannot\n  enforce IMDSv2.\n- **Single Spot instance type** is a **total-outage vector**: one Spot\n  interruption event affects 100% of Spot capacity.\n\n## Quick reference — verdict thresholds\n\n| Condition | Verdict | Rule |\n|---|---|---|\n| `HealthCheckType` includes ELB + no target group \u002F LB attached | **MISCONFIGURED** | Step 3 |\n| `LaunchConfigurationName` set (legacy LC) | **MISCONFIGURED** | Step 1 |\n| `DesiredCapacity > MaxSize` or `\u003C MinSize` | **MISCONFIGURED** | Step 2 |\n| MIP with 1 instance type + Spot allocation (\u003C 100% On-Demand) | **MISCONFIGURED** | Step 5 |\n| Launch template `HttpTokens != required` | **CONFIG_GAP** | Step 1 |\n| `HealthCheckGracePeriod \u003C 60` + ELB health check | **CONFIG_GAP** | Step 3 |\n| `HealthCheckType: EC2` + target group \u002F LB attached | **CONFIG_GAP** | Step 4 |\n| Spot allocation + `CapacityRebalance.Enabled != true` | **CONFIG_GAP** | Step 6 |\n| Single AZ only (`AvailabilityZones` has 1 entry) | **CONFIG_GAP** | Step 7 |\n| `MaxSize == DesiredCapacity` (no scale-out headroom) | **CONFIG_GAP** | Step 8 |\n| All dimensions pass | **OK** | Step 9 |\n\nSee the ordered steps below for edge cases. Deep ASG lifecycle internals\n(health-check evaluation pipeline, Spot rebalance timing, AZ rebalancing) are\nin the [Deep reference](#deep-reference-auto-scaling-internals) section.\n\n## Pre-flight: ASG metadata gate (run before classification)\n\nBefore evaluating the ASG configuration, classify the ASG's lifecycle state\nand launch source. Several attributes short-circuit the audit —\nmisclassifying them produces false positives.\n\n| Attribute | Value | Effect on audit |\n|---|---|---|\n| `LaunchConfigurationName` | set | **Legacy launch configuration.** Immediately MISCONFIGURED (Step 1). LCs are deprecated (no new creation since Dec 2023), cannot enforce IMDSv2, and are incompatible with MixedInstancesPolicy. |\n| `LaunchTemplate` | set | Proceed with full audit. This is the modern path. |\n| `MixedInstancesPolicy` | set | The ASG uses MIP — evaluate instance-type diversification (Step 5). MIP overrides the top-level `LaunchTemplate`. |\n| `SuspendedProcesses` | includes `HealthCheck` | **Suspended health checks.** The ASG will not replace unhealthy instances. Flag as operational risk — but classify the rest of the config normally. |\n| `SuspendedProcesses` | includes `Launch` \u002F `Terminate` | **Scaling is frozen.** The ASG cannot launch or terminate. Flag as operational risk. |\n\n**If the ASG configuration is malformed** (missing required fields like\n`MinSize`, `MaxSize`, `HealthCheckType`), output:\n\n```text\nASG: \u003Cname>\nVERDICT: ERROR\nREASON: ASG configuration is missing required fields — cannot classify.\nREMEDIATION: Retrieve the canonical config with\n  aws autoscaling describe-auto-scaling-groups --auto-scaling-group-names \u003Cname> --output json\n  and re-audit.\n```\n\n## Process — Classification logic (apply in order, aggregate worst)\n\n### Step 0: Expert knowledge — non-obvious ASG behaviors that change classification\n\nDeep dive moved to [references\u002Fadvanced-patterns.md](references\u002Fadvanced-patterns.md)\n(Step 0: non-obvious ASG behaviors) — load before classifying edge-case ASGs.\n\n### Step 1: Launch template \u002F configuration health\n\nEvaluate the launch source:\n\n- **MISCONFIGURED** if `LaunchConfigurationName` is set. Launch configurations\n  are deprecated (no new creation since Dec 2023), cannot enforce IMDSv2, and\n  are incompatible with MixedInstancesPolicy. This is a tech-debt dead end.\n\n- **CONFIG_GAP** if `LaunchTemplate` is set but `MetadataOptions.HttpTokens`\n  is not `\"required\"`. IMDSv2 is not enforced — the instance metadata service\n  is accessible via IMDSv1, which is vulnerable to SSRF attacks. An attacker\n  who can make the instance call `169.254.169.254` can steal IAM instance\n  profile credentials.\n\n- **OK** for this dimension if `LaunchTemplate` is set with\n  `HttpTokens: \"required\"`.\n\n### Step 2: Capacity configuration\n\nEvaluate the min\u002Fmax\u002Fdesired bounds:\n\n- **MISCONFIGURED** if `DesiredCapacity > MaxSize` or\n  `DesiredCapacity \u003C MinSize`. The ASG will immediately launch or terminate\n  instances to reach desired, but the desired value is logically inconsistent\n  with the bounds. `describe-auto-scaling-groups` may show the desired value\n  the user set, but the ASG corrects it silently — relying on silent\n  correction is a production hazard.\n\n- **CONFIG_GAP** if `MinSize` is 0 for a production ASG. With MinSize=0, the\n  ASG can scale to zero — the first scale-out has a cold start (AMI fetch +\n  userdata + ELB registration: 3-5 minutes). For production workloads,\n  MinSize >= 2 (one per AZ minimum) maintains baseline capacity.\n\n### Step 3: ELB health check integrity\n\nEvaluate the ELB health check wiring:\n\n- **MISCONFIGURED** if `HealthCheckType` includes `\"ELB\"` AND both\n  `TargetGroupARNs` and `LoadBalancerNames` are empty or missing. No ELB is\n  attached to report health — instances are treated as Unhealthy from launch,\n  creating an infinite replacement loop. This is the most costly silent\n  misconfiguration in Auto Scaling.\n\n- **CONFIG_GAP** if `HealthCheckType` includes `\"ELB\"` AND\n  `HealthCheckGracePeriod \u003C 60`. ELB target registration alone takes 30-60\n  seconds. A grace period under 60 seconds gives the application near-zero\n  time to boot and register before being evaluated — healthy instances get\n  terminated prematurely.\n\n### Step 4: Health check type appropriateness\n\nEvaluate whether the health check type matches the traffic architecture:\n\n- **CONFIG_GAP** if `HealthCheckType` is `\"EC2\"` (or does not include ELB) AND\n  (`TargetGroupARNs` is non-empty OR `LoadBalancerNames` is non-empty). An ELB\n  is attached but the ASG only checks EC2 status checks — a hung application\n  (process alive but not serving) is not detected. Use `HealthCheckType: ELB`\n  or `\"ELB,EC2\"` for ASGs that front traffic via a load balancer.\n\n### Step 5: Mixed-instances policy evaluation\n\nEvaluate Spot diversification and allocation:\n\n- **MISCONFIGURED** if `MixedInstancesPolicy` exists AND the `Overrides` list\n  has exactly 1 instance type AND Spot allocation is in use\n  (`OnDemandPercentageAboveBaseCapacity \u003C 100`). A single Spot instance type\n  means the next Spot interruption affects 100% of Spot capacity. Diversify\n  across 3+ instance types to survive pool-level interruptions.\n\n- **CONFIG_GAP** if no `MixedInstancesPolicy` exists AND the ASG uses a\n  `LaunchTemplate` (not LC). MIP provides instance-type flexibility, Spot\n  cost optimization, and AZ-aware allocation — all unavailable with a bare\n  launch template. This is a recommended-practice gap, not an active failure.\n\n### Step 6: Capacity rebalance (Spot)\n\n- **CONFIG_GAP** if Spot allocation is in use\n  (`OnDemandPercentageAboveBaseCapacity \u003C 100` within a `MixedInstancesPolicy`)\n  AND `CapacityRebalance.Enabled` is not `true`. Without Capacity Rebalance,\n  the ASG only reacts after a Spot instance is terminated — it does not\n  proactively launch a replacement on the rebalance recommendation. This\n  creates a capacity gap during the replacement window.\n\n### Step 7: AZ diversity\n\n- **CONFIG_GAP** if `AvailabilityZones` has exactly 1 entry (or\n  `VPCZoneIdentifier` references subnets in a single AZ). A single-AZ ASG has\n  no resilience — an AZ outage takes down the entire fleet. Minimum 2 AZs for\n  production; 3+ for high availability.\n\n### Step 8: Scale-out headroom\n\n- **CONFIG_GAP** if `MaxSize == DesiredCapacity`. The ASG can only scale in,\n  never out. If traffic spikes, there is zero elasticity. This may be\n  intentional for fixed-size groups, but for auto-scaling workloads it defeats\n  the purpose. Ensure `MaxSize > DesiredCapacity` for a meaningful scale-out\n  margin.\n\n### Step 9: Aggregation — worst finding wins\n\nThe final verdict is the **maximum severity** across all findings, where\nMISCONFIGURED > CONFIG_GAP > OK:\n\n```text\nverdict = max(all_finding_severities)\n```\n\nIf no findings (all dimensions pass), the verdict is **OK**.\n\n## Output format (per ASG)\n\n```text\nASG: \u003Cname>\nVERDICT: MISCONFIGURED | CONFIG_GAP | OK\nREASON: \u003C1-2 sentences citing the worst finding and its step number>\nFINDINGS:\n  - [MISCONFIGURED] \u003Cfinding description (Step N)>\n  - [CONFIG_GAP] \u003Cfinding description (Step N)>\n  - [OK] \u003Cdimension that passed>\nREMEDIATION: \u003Cspecific action per finding, or \"None required\" if OK>\n```\n\n### Worked example — Spot single instance type\n\n```text\nASG: prod-spot-asg\nVERDICT: MISCONFIGURED\nREASON: MixedInstancesPolicy has 1 instance type (c5.large) with Spot\nallocation (OnDemandPercentageAboveBaseCapacity=0) — a single Spot interruption\naffects 100% of capacity (Step 5). CapacityRebalance is also disabled,\ncompounding the risk.\nFINDINGS:\n  - [MISCONFIGURED] Single Spot instance type (c5.large) with 0% On-Demand —\n    no diversification against pool-level interruption (Step 5)\n  - [CONFIG_GAP] CapacityRebalance.Enabled is false on a Spot-backed ASG —\n    no proactive replacement on rebalance recommendation (Step 6)\n  - [OK] Launch template with IMDSv2 required (Step 1)\nREMEDIATION:\n  1. Add 2+ instance types to Overrides (e.g., c5.large, c5a.large, m5.large)\n     to diversify Spot pools.\n  2. Set SpotAllocationStrategy to capacity-optimized to minimize\n     interruptions.\n  3. Enable CapacityRebalance:\n     aws autoscaling create-or-update-tags --tags\n       Key=capacity-rebalance,Value=true,...\n     (or update via create-auto-scaling-group \u002F update-auto-scaling-group\n     with --capacity-rebalance)\n```\n\n## Anti-Patterns — NEVER\n\n- NEVER classify `HealthCheckType: ELB` with no target group as anything other\n  than MISCONFIGURED. Without an attached ELB, no health data is returned —\n  every instance is Unhealthy from launch, creating an infinite replacement\n  loop. This is not \"suboptimal\" — it is actively burning compute budget.\n\n- NEVER treat a launch configuration as equivalent to a launch template. LCs\n  are deprecated, cannot enforce IMDSv2, and are incompatible with\n  MixedInstancesPolicy. Any ASG using `LaunchConfigurationName` is locked out\n  of modern EC2 features.\n\n- NEVER assume `HealthCheckGracePeriod` is measured from ELB registration. It\n  is measured from instance **launch**. ELB registration takes 30-60s — a\n  60s grace period gives the app near-zero warmup time. Treat \u003C 60s with ELB\n  checks as a CONFIG_GAP.\n\n- NEVER classify a single Spot instance type in a MixedInstancesPolicy as\n  CONFIG_GAP. With Spot allocation (`OnDemandPercentageAboveBaseCapacity \u003C\n  100`), a single instance type means one interruption event affects 100% of\n  capacity. This is MISCONFIGURED — the ASG will lose all Spot capacity on\n  the next pool drain.\n\n- NEVER assume `HealthCheckType: EC2` detects application failure. EC2 status\n  checks verify hypervisor-level health only. A hung application (process\n  alive, port open, not serving requests) passes EC2 checks. If the ASG has\n  a target group attached, the health check type should include ELB.\n\n- NEVER treat `OnDemandPercentageAboveBaseCapacity` as the total On-Demand\n  percentage. It applies **above** `OnDemandBaseCapacity`. Base=2, Percent=50\n  means the first 2 instances are On-Demand, then 50% of the remainder. The\n  effective On-Demand ratio depends on DesiredCapacity.\n\n- NEVER set `SpotAllocationStrategy: capacity-optimized` and also set\n  `SpotInstancePools`. `SpotInstancePools` only applies to `lowest-price`.\n  With `capacity-optimized`, `SpotInstancePools` is dead configuration — it\n  has no effect. Do not rely on it for diversification.\n\n- NEVER assume `$Latest` launch template version is safe for production. When\n  the template is updated, `$Latest` immediately redirects. New instances use\n  the new version while old instances keep theirs — fleet split. If the new\n  version is broken, new instances fail and cycle infinitely. Pin a specific\n  version number for production ASGs.\n\n- NEVER assume an ASG with `MaxSize == DesiredCapacity` can scale. It can only\n  scale in. For auto-scaling workloads, ensure `MaxSize > DesiredCapacity`.\n  This is CONFIG_GAP, not MISCONFIGURED — the ASG works, it just has no\n  scale-out elasticity.\n\n- NEVER assume Standby instances free up capacity. Standby instances count\n  against `MaxSize` but not `DesiredCapacity`. If MaxSize is tight, Standby\n  instances block scale-out. Check Standby count before scaling operations.\n\n- NEVER modify an ASG's launch template without considering the instance\n  refresh. Changing `$Latest` or pinning a new version does not automatically\n  update existing instances — they keep their old version until replaced. Use\n  `aws autoscaling start-instance-refresh` to roll out the change safely.\n\n- NEVER ignore `SuspendedProcesses`. An ASG with `HealthCheck` suspended will\n  not replace unhealthy instances. An ASG with `Launch` or `Terminate`\n  suspended cannot scale at all. Always check suspended processes before\n  classifying capacity or health behavior.\n\n## Pre-flight safety checks (run before any remediation CLI)\n\n- **MANDATORY CONFIRMATION GATE.** Before any state-changing operation\n  (UpdateAutoScalingGroup, StartInstanceRefresh, PutScalingPolicy,\n  DetachLoadBalancerTargetGroups), the auditor MUST emit:\n  `CONFIRM: About to \u003Caction> on ASG \u003Cname> in account \u003Caccount>. This\n  affects \u003Cconsequence>. Proceed? (yes\u002Fno)`\n\n- **Snapshot the current ASG config for rollback:**\n  `aws autoscaling describe-auto-scaling-groups --auto-scaling-group-names \u003Cname> --output json > \u002Ftmp\u002F\u003Cname>-backup-$(date +%s).json`\n  BEFORE any modification. ASG configs are not versioned — there is no undo\n  without a backup.\n\n- **Instance refresh safety.** Before starting an instance refresh to roll out\n  a new launch template version, verify: (1) `MinHealthyPercentage` is set\n  (default 90 — too high for small ASGs); (2) the new template version has\n  been tested on a canary instance or non-prod ASG; (3) the ASG's health\n  check grace period is long enough for the new AMI\u002Fuserdata to complete\n  boot. A failed instance refresh can take down the entire fleet.\n\n- **Capacity bounds check.** Before changing MinSize\u002FMaxSize\u002FDesiredCapacity,\n  verify the new values are internally consistent (MinSize \u003C= DesiredCapacity\n  \u003C= MaxSize) and that the account has sufficient On-Demand or Spot capacity\n  in the target AZs. Use\n  `aws service-quotas get-service-quota --service-code autoscaling --quota-code L-...`\n  to check ASG resource limits.\n\n- **Spot allocation warning.** Before increasing Spot percentage or adding\n  instance types, check\n  `aws ec2 describe-spot-price-history` for recent price stability in the\n  target AZs. A pool that was stable yesterday may be under pressure today.\n\n## Remediation guidance\n\n### For MISCONFIGURED — ELB health check with no target group (Step 3)\n\n1. Attach the target group:\n   `aws autoscaling attach-load-balancer-target-groups --auto-scaling-group-name \u003Cname> --target-group-arns \u003Carn>`\n2. Verify the target group has a configured health check:\n   `aws elbv2 describe-target-groups --target-group-arns \u003Carn>`\n   The health check path, interval, and healthy threshold must match the\n   application's boot time.\n3. If the ASG should NOT use ELB health checks (e.g., background workers),\n   switch: `aws autoscaling update-auto-scaling-group --auto-scaling-group-name \u003Cname> --health-check-type EC2`\n\n### For MISCONFIGURED — legacy launch configuration (Step 1)\n\n1. Create a launch template from the launch configuration:\n   `aws ec2 create-launch-template --launch-template-name \u003Cname> --launch-template-data file:\u002F\u002Ftemplate.json`\n2. Update the ASG to use the template:\n   `aws autoscaling update-auto-scaling-group --auto-scaling-group-name \u003Cname> --launch-template LaunchTemplateId=\u003Cid>,Version=1`\n3. Start an instance refresh to roll existing instances to the new template:\n   `aws autoscaling start-instance-refresh --auto-scaling-group-name \u003Cname>`\n\n### For MISCONFIGURED — single Spot instance type (Step 5)\n\n1. Add 2+ instance types to the MIP Overrides. Choose types with similar\n   vCPU\u002Fmemory (e.g., c5.large, c5a.large, m5.large).\n2. Set `SpotAllocationStrategy: capacity-optimized` to minimize interruptions.\n3. Enable CapacityRebalance:\n   `aws autoscaling update-auto-scaling-group --auto-scaling-group-name \u003Cname> --capacity-rebalance`\n\n### For CONFIG_GAP — IMDSv2 not required (Step 1)\n\n1. Update the launch template with a new version enforcing IMDSv2:\n   `aws ec2 create-launch-template-version --launch-template-id \u003Cid> --launch-template-data '{\"MetadataOptions\":{\"HttpTokens\":\"required\"}}'`\n2. Update the ASG to use the new version:\n   `aws autoscaling update-auto-scaling-group --auto-scaling-group-name \u003Cname> --launch-template LaunchTemplateId=\u003Cid>,Version=\u003Cn>`\n3. Start an instance refresh to enforce on existing instances.\n\n### For CONFIG_GAP — short grace period (Step 3)\n\n1. Increase `HealthCheckGracePeriod` to at least 300 seconds:\n   `aws autoscaling update-auto-scaling-group --auto-scaling-group-name \u003Cname> --health-check-grace-period 300`\n\n### For CONFIG_GAP — EC2 health check behind ELB (Step 4)\n\n1. Switch to ELB health checks:\n   `aws autoscaling update-auto-scaling-group --auto-scaling-group-name \u003Cname> --health-check-type ELB`\n2. Verify the target group health check is configured correctly (path, port,\n   interval, healthy threshold).\n\n### For OK\n\n1. No remediation required for the current posture.\n2. Recommend enabling Instance Refresh warmup checks if not already configured.\n3. Recommend setting `NewInstancesProtectedFromScaleIn: true` for stateful\n   workloads to prevent scale-in from terminating new instances before they\n   receive traffic.\n\n## Deep reference: Auto Scaling internals\n\nInternals moved to [references\u002Fadvanced-patterns.md](references\u002Fadvanced-patterns.md)\n(health-check lifecycle, Spot rebalance timing, OnDemand\u002FSpot math, AZ rebalancing) — load on demand.\n\n## Recent AWS features (2024-2026)\n\nFeature notes moved to [references\u002Fadvanced-patterns.md](references\u002Fadvanced-patterns.md).\nLoad when deciding whether a recent feature changes the audit.\n\n## References (load on demand)\n\n- [references\u002Fadvanced-patterns.md](references\u002Fadvanced-patterns.md) — Step-0 expert deep dive, Auto Scaling internals (health-check lifecycle, Spot rebalancing, capacity math, AZ rebalancing), recent AWS features\n\n## Domain\n\nAWS CloudOps \u002F Compute Elasticity & Auto Scaling Health.\n\n## AWS documentation\n\n- **Amazon EC2 Auto Scaling User Guide** — https:\u002F\u002Fdocs.aws.amazon.com\u002Fautoscaling\u002Fec2\u002Fuserguide\u002Fwhat-is-amazon-ec2-auto-scaling.html\n- **Auto Scaling API Reference** — https:\u002F\u002Fdocs.aws.amazon.com\u002Fautoscaling\u002Fec2\u002FAPIReference\u002F\n- **Auto Scaling Security** — https:\u002F\u002Fdocs.aws.amazon.com\u002Fautoscaling\u002Fec2\u002Fuserguide\u002Fsecurity.html\n- **Auto Scaling CLI Reference** — https:\u002F\u002Fdocs.aws.amazon.com\u002Fcli\u002Flatest\u002Freference\u002Fautoscaling\u002F\n- **Blog: Instance maintenance policies** — https:\u002F\u002Faws.amazon.com\u002Fblogs\u002Fcompute\u002Fproactively-manage-instance-maintenance-with-amazon-ec2-auto-scaling-instance-maintenance-policy\u002F\n","# Auto Scaling Group Auditor\n\n## Mindset\n\n**One-line takeaway:** the verdict is always the **worst** finding across all\ndimensions, and three ASG misconfigurations are silent killers —\nHealthCheckType=ELB with no target group (infinite replacement loop),\nlaunch-configuration usage (locked out of IMDSv2 and mixed-instances), and a\nsingle Spot instance type (one interruption takes down everything).\n\nAn Auto Scaling Group is the elasticity engine of EC2 workloads. Its\nconfiguration sits at the intersection of launch infrastructure (templates,\nAMIs, IMDSv2), health detection (ELB vs EC2 checks, grace periods), capacity\nplanning (min\u002Fmax\u002Fdesired bounds, Spot diversification), and failure recovery\n(termination policies, capacity rebalance). A misconfiguration in any\ndimension produces silent degradation — the ASG keeps running but instances\ncycle, apps hang undetected, or Spot interruptions cascade.\n\n- **ELB health check with no target group** is a **silent infinite loop**: the\n  ASG launches, the ELB never reports health, the ASG terminates and relaunches\n  — indefinitely. It looks like \"high churn,\" not an obvious error.\n- **Launch configuration** is a **technical-debt dead end**: deprecated for new\n  creation (Dec 2023), incompatible with MixedInstancesPolicy, and cannot\n  enforce IMDSv2.\n- **Single Spot instance type** is a **total-outage vector**: one Spot\n  interruption event affects 100% of Spot capacity.\n\n## Quick reference — verdict thresholds\n\n| Condition | Verdict | Rule |\n|---|---|---|\n| `HealthCheckType` includes ELB + no target group \u002F LB attached | **MISCONFIGURED** | Step 3 |\n| `LaunchConfigurationName` set (legacy LC) | **MISCONFIGURED** | Step 1 |\n| `DesiredCapacity > MaxSize` or `\u003C MinSize` | **MISCONFIGURED** | Step 2 |\n| MIP with 1 instance type + Spot allocation (\u003C 100% On-Demand) | **MISCONFIGURED** | Step 5 |\n| Launch template `HttpTokens != required` | **CONFIG_GAP** | Step 1 |\n| `HealthCheckGracePeriod \u003C 60` + ELB health check | **CONFIG_GAP** | Step 3 |\n| `HealthCheckType: EC2` + target group \u002F LB attached | **CONFIG_GAP** | Step 4 |\n| Spot allocation + `CapacityRebalance.Enabled != true` | **CONFIG_GAP** | Step 6 |\n| Single AZ only (`AvailabilityZones` has 1 entry) | **CONFIG_GAP** | Step 7 |\n| `MaxSize == DesiredCapacity` (no scale-out headroom) | **CONFIG_GAP** | Step 8 |\n| All dimensions pass | **OK** | Step 9 |\n\nSee the ordered steps below for edge cases. Deep ASG lifecycle internals\n(health-check evaluation pipeline, Spot rebalance timing, AZ rebalancing) are\nin the [Deep reference](#deep-reference-auto-scaling-internals) section.\n\n## Pre-flight: ASG metadata gate (run before classification)\n\nBefore evaluating the ASG configuration, classify the ASG's lifecycle state\nand launch source. Several attributes short-circuit the audit —\nmisclassifying them produces false positives.\n\n| Attribute | Value | Effect on audit |\n|---|---|---|\n| `LaunchConfigurationName` | set | **Legacy launch configuration.** Immediately MISCONFIGURED (Step 1). LCs are deprecated (no new creation since Dec 2023), cannot enforce IMDSv2, and are incompatible with MixedInstancesPolicy. |\n| `LaunchTemplate` | set | Proceed with full audit. This is the modern path. |\n| `MixedInstancesPolicy` | set | The ASG uses MIP — evaluate instance-type diversification (Step 5). MIP overrides the top-level `LaunchTemplate`. |\n| `SuspendedProcesses` | includes `HealthCheck` | **Suspended health checks.** The ASG will not replace unhealthy instances. Flag as operational risk — but classify the rest of the config normally. |\n| `SuspendedProcesses` | includes `Launch` \u002F `Terminate` | **Scaling is frozen.** The ASG cannot launch or terminate. Flag as operational risk. |\n\n**If the ASG configuration is malformed** (missing required fields like\n`MinSize`, `MaxSize`, `HealthCheckType`), output:\n\n```text\nASG: \u003Cname>\nVERDICT: ERROR\nREASON: ASG configuration is missing required fields — cannot classify.\nREMEDIATION: Retrieve the canonical config with\n  aws autoscaling describe-auto-scaling-groups --auto-scaling-group-names \u003Cname> --output json\n  and re-audit.\n```\n\n## Process — Classification logic (apply in order, aggregate worst)\n\n### Step 0: Expert knowledge — non-obvious ASG behaviors that change classification\n\nDeep dive moved to [references\u002Fadvanced-patterns.md](references\u002Fadvanced-patterns.md)\n(Step 0: non-obvious ASG behaviors) — load before classifying edge-case ASGs.\n\n### Step 1: Launch template \u002F configuration health\n\nEvaluate the launch source:\n\n- **MISCONFIGURED** if `LaunchConfigurationName` is set. Launch configurations\n  are deprecated (no new creation since Dec 2023), cannot enforce IMDSv2, and\n  are incompatible with MixedInstancesPolicy. This is a tech-debt dead end.\n\n- **CONFIG_GAP** if `LaunchTemplate` is set but `MetadataOptions.HttpTokens`\n  is not `\"required\"`. IMDSv2 is not enforced — the instance metadata service\n  is accessible via IMDSv1, which is vulnerable to SSRF attacks. An attacker\n  who can make the instance call `169.254.169.254` can steal IAM instance\n  profile credentials.\n\n- **OK** for this dimension if `LaunchTemplate` is set with\n  `HttpTokens: \"required\"`.\n\n### Step 2: Capacity configuration\n\nEvaluate the min\u002Fmax\u002Fdesired bounds:\n\n- **MISCONFIGURED** if `DesiredCapacity > MaxSize` or\n  `DesiredCapacity \u003C MinSize`. The ASG will immediately launch or terminate\n  instances to reach desired, but the desired value is logically inconsistent\n  with the bounds. `describe-auto-scaling-groups` may show the desired value\n  the user set, but the ASG corrects it silently — relying on silent\n  correction is a production hazard.\n\n- **CONFIG_GAP** if `MinSize` is 0 for a production ASG. With MinSize=0, the\n  ASG can scale to zero — the first scale-out has a cold start (AMI fetch +\n  userdata + ELB registration: 3-5 minutes). For production workloads,\n  MinSize >= 2 (one per AZ minimum) maintains baseline capacity.\n\n### Step 3: ELB health check integrity\n\nEvaluate the ELB health check wiring:\n\n- **MISCONFIGURED** if `HealthCheckType` includes `\"ELB\"` AND both\n  `TargetGroupARNs` and `LoadBalancerNames` are empty or missing. No ELB is\n  attached to report health — instances are treated as Unhealthy from launch,\n  creating an infinite replacement loop. This is the most costly silent\n  misconfiguration in Auto Scaling.\n\n- **CONFIG_GAP** if `HealthCheckType` includes `\"ELB\"` AND\n  `HealthCheckGracePeriod \u003C 60`. ELB target registration alone takes 30-60\n  seconds. A grace period under 60 seconds gives the application near-zero\n  time to boot and register before being evaluated — healthy instances get\n  terminated prematurely.\n\n### Step 4: Health check type appropriateness\n\nEvaluate whether the health check type matches the traffic architecture:\n\n- **CONFIG_GAP** if `HealthCheckType` is `\"EC2\"` (or does not include ELB) AND\n  (`TargetGroupARNs` is non-empty OR `LoadBalancerNames` is non-empty). An ELB\n  is attached but the ASG only checks EC2 status checks — a hung application\n  (process alive but not serving) is not detected. Use `HealthCheckType: ELB`\n  or `\"ELB,EC2\"` for ASGs that front traffic via a load balancer.\n\n### Step 5: Mixed-instances policy evaluation\n\nEvaluate Spot diversification and allocation:\n\n- **MISCONFIGURED** if `MixedInstancesPolicy` exists AND the `Overrides` list\n  has exactly 1 instance type AND Spot allocation is in use\n  (`OnDemandPercentageAboveBaseCapacity \u003C 100`). A single Spot instance type\n  means the next Spot interruption affects 100% of Spot capacity. Diversify\n  across 3+ instance types to survive pool-level interruptions.\n\n- **CONFIG_GAP** if no `MixedInstancesPolicy` exists AND the ASG uses a\n  `LaunchTemplate` (not LC). MIP provides instance-type flexibility, Spot\n  cost optimization, and AZ-aware allocation — all unavailable with a bare\n  launch template. This is a recommended-practice gap, not an active failure.\n\n### Step 6: Capacity rebalance (Spot)\n\n- **CONFIG_GAP** if Spot allocation is in use\n  (`OnDemandPercentageAboveBaseCapacity \u003C 100` within a `MixedInstancesPolicy`)\n  AND `CapacityRebalance.Enabled` is not `true`. Without Capacity Rebalance,\n  the ASG only reacts after a Spot instance is terminated — it does not\n  proactively launch a replacement on the rebalance recommendation. This\n  creates a capacity gap during the replacement window.\n\n### Step 7: AZ diversity\n\n- **CONFIG_GAP** if `AvailabilityZones` has exactly 1 entry (or\n  `VPCZoneIdentifier` references subnets in a single AZ). A single-AZ ASG has\n  no resilience — an AZ outage takes down the entire fleet. Minimum 2 AZs for\n  production; 3+ for high availability.\n\n### Step 8: Scale-out headroom\n\n- **CONFIG_GAP** if `MaxSize == DesiredCapacity`. The ASG can only scale in,\n  never out. If traffic spikes, there is zero elasticity. This may be\n  intentional for fixed-size groups, but for auto-scaling workloads it defeats\n  the purpose. Ensure `MaxSize > DesiredCapacity` for a meaningful scale-out\n  margin.\n\n### Step 9: Aggregation — worst finding wins\n\nThe final verdict is the **maximum severity** across all findings, where\nMISCONFIGURED > CONFIG_GAP > OK:\n\n```text\nverdict = max(all_finding_severities)\n```\n\nIf no findings (all dimensions pass), the verdict is **OK**.\n\n## Output format (per ASG)\n\n```text\nASG: \u003Cname>\nVERDICT: MISCONFIGURED | CONFIG_GAP | OK\nREASON: \u003C1-2 sentences citing the worst finding and its step number>\nFINDINGS:\n  - [MISCONFIGURED] \u003Cfinding description (Step N)>\n  - [CONFIG_GAP] \u003Cfinding description (Step N)>\n  - [OK] \u003Cdimension that passed>\nREMEDIATION: \u003Cspecific action per finding, or \"None required\" if OK>\n```\n\n### Worked example — Spot single instance type\n\n```text\nASG: prod-spot-asg\nVERDICT: MISCONFIGURED\nREASON: MixedInstancesPolicy has 1 instance type (c5.large) with Spot\nallocation (OnDemandPercentageAboveBaseCapacity=0) — a single Spot interruption\naffects 100% of capacity (Step 5). CapacityRebalance is also disabled,\ncompounding the risk.\nFINDINGS:\n  - [MISCONFIGURED] Single Spot instance type (c5.large) with 0% On-Demand —\n    no diversification against pool-level interruption (Step 5)\n  - [CONFIG_GAP] CapacityRebalance.Enabled is false on a Spot-backed ASG —\n    no proactive replacement on rebalance recommendation (Step 6)\n  - [OK] Launch template with IMDSv2 required (Step 1)\nREMEDIATION:\n  1. Add 2+ instance types to Overrides (e.g., c5.large, c5a.large, m5.large)\n     to diversify Spot pools.\n  2. Set SpotAllocationStrategy to capacity-optimized to minimize\n     interruptions.\n  3. Enable CapacityRebalance:\n     aws autoscaling create-or-update-tags --tags\n       Key=capacity-rebalance,Value=true,...\n     (or update via create-auto-scaling-group \u002F update-auto-scaling-group\n     with --capacity-rebalance)\n```\n\n## Anti-Patterns — NEVER\n\n- NEVER classify `HealthCheckType: ELB` with no target group as anything other\n  than MISCONFIGURED. Without an attached ELB, no health data is returned —\n  every instance is Unhealthy from launch, creating an infinite replacement\n  loop. This is not \"suboptimal\" — it is actively burning compute budget.\n\n- NEVER treat a launch configuration as equivalent to a launch template. LCs\n  are deprecated, cannot enforce IMDSv2, and are incompatible with\n  MixedInstancesPolicy. Any ASG using `LaunchConfigurationName` is locked out\n  of modern EC2 features.\n\n- NEVER assume `HealthCheckGracePeriod` is measured from ELB registration. It\n  is measured from instance **launch**. ELB registration takes 30-60s — a\n  60s grace period gives the app near-zero warmup time. Treat \u003C 60s with ELB\n  checks as a CONFIG_GAP.\n\n- NEVER classify a single Spot instance type in a MixedInstancesPolicy as\n  CONFIG_GAP. With Spot allocation (`OnDemandPercentageAboveBaseCapacity \u003C\n  100`), a single instance type means one interruption event affects 100% of\n  capacity. This is MISCONFIGURED — the ASG will lose all Spot capacity on\n  the next pool drain.\n\n- NEVER assume `HealthCheckType: EC2` detects application failure. EC2 status\n  checks verify hypervisor-level health only. A hung application (process\n  alive, port open, not serving requests) passes EC2 checks. If the ASG has\n  a target group attached, the health check type should include ELB.\n\n- NEVER treat `OnDemandPercentageAboveBaseCapacity` as the total On-Demand\n  percentage. It applies **above** `OnDemandBaseCapacity`. Base=2, Percent=50\n  means the first 2 instances are On-Demand, then 50% of the remainder. The\n  effective On-Demand ratio depends on DesiredCapacity.\n\n- NEVER set `SpotAllocationStrategy: capacity-optimized` and also set\n  `SpotInstancePools`. `SpotInstancePools` only applies to `lowest-price`.\n  With `capacity-optimized`, `SpotInstancePools` is dead configuration — it\n  has no effect. Do not rely on it for diversification.\n\n- NEVER assume `$Latest` launch template version is safe for production. When\n  the template is updated, `$Latest` immediately redirects. New instances use\n  the new version while old instances keep theirs — fleet split. If the new\n  version is broken, new instances fail and cycle infinitely. Pin a specific\n  version number for production ASGs.\n\n- NEVER assume an ASG with `MaxSize == DesiredCapacity` can scale. It can only\n  scale in. For auto-scaling workloads, ensure `MaxSize > DesiredCapacity`.\n  This is CONFIG_GAP, not MISCONFIGURED — the ASG works, it just has no\n  scale-out elasticity.\n\n- NEVER assume Standby instances free up capacity. Standby instances count\n  against `MaxSize` but not `DesiredCapacity`. If MaxSize is tight, Standby\n  instances block scale-out. Check Standby count before scaling operations.\n\n- NEVER modify an ASG's launch template without considering the instance\n  refresh. Changing `$Latest` or pinning a new version does not automatically\n  update existing instances — they keep their old version until replaced. Use\n  `aws autoscaling start-instance-refresh` to roll out the change safely.\n\n- NEVER ignore `SuspendedProcesses`. An ASG with `HealthCheck` suspended will\n  not replace unhealthy instances. An ASG with `Launch` or `Terminate`\n  suspended cannot scale at all. Always check suspended processes before\n  classifying capacity or health behavior.\n\n## Pre-flight safety checks (run before any remediation CLI)\n\n- **MANDATORY CONFIRMATION GATE.** Before any state-changing operation\n  (UpdateAutoScalingGroup, StartInstanceRefresh, PutScalingPolicy,\n  DetachLoadBalancerTargetGroups), the auditor MUST emit:\n  `CONFIRM: About to \u003Caction> on ASG \u003Cname> in account \u003Caccount>. This\n  affects \u003Cconsequence>. Proceed? (yes\u002Fno)`\n\n- **Snapshot the current ASG config for rollback:**\n  `aws autoscaling describe-auto-scaling-groups --auto-scaling-group-names \u003Cname> --output json > \u002Ftmp\u002F\u003Cname>-backup-$(date +%s).json`\n  BEFORE any modification. ASG configs are not versioned — there is no undo\n  without a backup.\n\n- **Instance refresh safety.** Before starting an instance refresh to roll out\n  a new launch template version, verify: (1) `MinHealthyPercentage` is set\n  (default 90 — too high for small ASGs); (2) the new template version has\n  been tested on a canary instance or non-prod ASG; (3) the ASG's health\n  check grace period is long enough for the new AMI\u002Fuserdata to complete\n  boot. A failed instance refresh can take down the entire fleet.\n\n- **Capacity bounds check.** Before changing MinSize\u002FMaxSize\u002FDesiredCapacity,\n  verify the new values are internally consistent (MinSize \u003C= DesiredCapacity\n  \u003C= MaxSize) and that the account has sufficient On-Demand or Spot capacity\n  in the target AZs. Use\n  `aws service-quotas get-service-quota --service-code autoscaling --quota-code L-...`\n  to check ASG resource limits.\n\n- **Spot allocation warning.** Before increasing Spot percentage or adding\n  instance types, check\n  `aws ec2 describe-spot-price-history` for recent price stability in the\n  target AZs. A pool that was stable yesterday may be under pressure today.\n\n## Remediation guidance\n\n### For MISCONFIGURED — ELB health check with no target group (Step 3)\n\n1. Attach the target group:\n   `aws autoscaling attach-load-balancer-target-groups --auto-scaling-group-name \u003Cname> --target-group-arns \u003Carn>`\n2. Verify the target group has a configured health check:\n   `aws elbv2 describe-target-groups --target-group-arns \u003Carn>`\n   The health check path, interval, and healthy threshold must match the\n   application's boot time.\n3. If the ASG should NOT use ELB health checks (e.g., background workers),\n   switch: `aws autoscaling update-auto-scaling-group --auto-scaling-group-name \u003Cname> --health-check-type EC2`\n\n### For MISCONFIGURED — legacy launch configuration (Step 1)\n\n1. Create a launch template from the launch configuration:\n   `aws ec2 create-launch-template --launch-template-name \u003Cname> --launch-template-data file:\u002F\u002Ftemplate.json`\n2. Update the ASG to use the template:\n   `aws autoscaling update-auto-scaling-group --auto-scaling-group-name \u003Cname> --launch-template LaunchTemplateId=\u003Cid>,Version=1`\n3. Start an instance refresh to roll existing instances to the new template:\n   `aws autoscaling start-instance-refresh --auto-scaling-group-name \u003Cname>`\n\n### For MISCONFIGURED — single Spot instance type (Step 5)\n\n1. Add 2+ instance types to the MIP Overrides. Choose types with similar\n   vCPU\u002Fmemory (e.g., c5.large, c5a.large, m5.large).\n2. Set `SpotAllocationStrategy: capacity-optimized` to minimize interruptions.\n3. Enable CapacityRebalance:\n   `aws autoscaling update-auto-scaling-group --auto-scaling-group-name \u003Cname> --capacity-rebalance`\n\n### For CONFIG_GAP — IMDSv2 not required (Step 1)\n\n1. Update the launch template with a new version enforcing IMDSv2:\n   `aws ec2 create-launch-template-version --launch-template-id \u003Cid> --launch-template-data '{\"MetadataOptions\":{\"HttpTokens\":\"required\"}}'`\n2. Update the ASG to use the new version:\n   `aws autoscaling update-auto-scaling-group --auto-scaling-group-name \u003Cname> --launch-template LaunchTemplateId=\u003Cid>,Version=\u003Cn>`\n3. Start an instance refresh to enforce on existing instances.\n\n### For CONFIG_GAP — short grace period (Step 3)\n\n1. Increase `HealthCheckGracePeriod` to at least 300 seconds:\n   `aws autoscaling update-auto-scaling-group --auto-scaling-group-name \u003Cname> --health-check-grace-period 300`\n\n### For CONFIG_GAP — EC2 health check behind ELB (Step 4)\n\n1. Switch to ELB health checks:\n   `aws autoscaling update-auto-scaling-group --auto-scaling-group-name \u003Cname> --health-check-type ELB`\n2. Verify the target group health check is configured correctly (path, port,\n   interval, healthy threshold).\n\n### For OK\n\n1. No remediation required for the current posture.\n2. Recommend enabling Instance Refresh warmup checks if not already configured.\n3. Recommend setting `NewInstancesProtectedFromScaleIn: true` for stateful\n   workloads to prevent scale-in from terminating new instances before they\n   receive traffic.\n\n## Deep reference: Auto Scaling internals\n\nInternals moved to [references\u002Fadvanced-patterns.md](references\u002Fadvanced-patterns.md)\n(health-check lifecycle, Spot rebalance timing, OnDemand\u002FSpot math, AZ rebalancing) — load on demand.\n\n## Recent AWS features (2024-2026)\n\nFeature notes moved to [references\u002Fadvanced-patterns.md](references\u002Fadvanced-patterns.md).\nLoad when deciding whether a recent feature changes the audit.\n\n## References (load on demand)\n\n- [references\u002Fadvanced-patterns.md](references\u002Fadvanced-patterns.md) — Step-0 expert deep dive, Auto Scaling internals (health-check lifecycle, Spot rebalancing, capacity math, AZ rebalancing), recent AWS features\n\n## Domain\n\nAWS CloudOps \u002F Compute Elasticity & Auto Scaling Health.\n\n## AWS documentation\n\n- **Amazon EC2 Auto Scaling User Guide** — https:\u002F\u002Fdocs.aws.amazon.com\u002Fautoscaling\u002Fec2\u002Fuserguide\u002Fwhat-is-amazon-ec2-auto-scaling.html\n- **Auto Scaling API Reference** — https:\u002F\u002Fdocs.aws.amazon.com\u002Fautoscaling\u002Fec2\u002FAPIReference\u002F\n- **Auto Scaling Security** — https:\u002F\u002Fdocs.aws.amazon.com\u002Fautoscaling\u002Fec2\u002Fuserguide\u002Fsecurity.html\n- **Auto Scaling CLI Reference** — https:\u002F\u002Fdocs.aws.amazon.com\u002Fcli\u002Flatest\u002Freference\u002Fautoscaling\u002F\n- **Blog: Instance maintenance policies** — https:\u002F\u002Faws.amazon.com\u002Fblogs\u002Fcompute\u002Fproactively-manage-instance-maintenance-with-amazon-ec2-auto-scaling-instance-maintenance-policy\u002F\n",{"name":5,"license":15,"metadata":24,"description":7,"compatibility":39},{"tags":25,"phase":26,"author":27,"domain":28,"family":29,"version":30,"keywords":31,"complexity":32,"entry_point":33,"when_to_use":34,"requires_llm":35,"verdict_shape":36,"invocation_schema":37,"supports_pipeline":35,"activation_triggers":38},"autoscaling, compute, launch-template, elb-health, spot, capacity, mixed-instances, audit","2","Jacky Chan — AWS Community Builder","aws-cloudops","Compute","0.1.0","Auto Scaling, ASG, launch template, launch configuration, ELB health check, target group, mixed instances, Spot, capacity, unhealthy termination, IMDSv2, CapacityRebalance, HealthCheckGracePeriod, SpotAllocationStrategy, OnDemandPercentageAboveBaseCapacity, TerminationPolicies, AvailabilityZones, fleet split, ASG audit, auto scaling remediation","high","false","Reviewing an ASG configuration before production deployment, checking launch-template or launch-configuration wiring, validating ELB health checks and grace-period timing, auditing Spot instance diversification, verifying capacity bounds, or investigating unhealthy-instance replacement loops.","true","MISCONFIGURED | CONFIG_GAP | OK","Input: either (a) an ASG configuration (launch template\u002Fconfig, capacity bounds, health check settings, mixed-instances policy, AZs), optionally paired with launch-template metadata, OR (b) an ASG name\u002FARN for live-account audit. Output: deterministic ASG\u002FVERDICT\u002FREASON\u002FFINDINGS\u002F REMEDIATION block per group, where VERDICT is MISCONFIGURED, CONFIG_GAP, OK, or ERROR.","audit this auto scaling group, check ASG health check, is my ASG misconfigured, launch template vs launch configuration, ELB health check no target group, spot single instance type, ASG capacity bounds, health check grace period too short, capacity rebalance spot, ASG infinite replacement loop","Agent runtime that reads SKILL.md (Claude Code, Cursor, Windsurf, Codex, Gemini). No AWS CLI required for offline ASG-config classification. Live-account audits use aws autoscaling describe-auto-scaling-groups, aws ec2 describe-launch-templates, and aws elbv2 describe-target-groups (AWS CLI v2, SSO or key-based credentials).","main","eeace51bd5dd1db2030729d83eeab988861553aa","skills\u002Fautoscaling-group-auditor",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":49,"prompt":59,"zipAvailable":60},[50,53,56],{"tool":51,"command":52},"npx","npx skills add jhkchan\u002Faws-agent-skills --skill autoscaling-group-auditor",{"tool":54,"command":55},"bunx","bunx skills add jhkchan\u002Faws-agent-skills --skill autoscaling-group-auditor",{"tool":57,"command":58},"pnpm","pnpm dlx skills add jhkchan\u002Faws-agent-skills --skill autoscaling-group-auditor","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fjhkchan\u002Faws-agent-skills\u002Fblob\u002Fmain\u002Fskills\u002Fautoscaling-group-auditor\u002FSKILL.md",true,[62,68,72,76,80,84,88,92,96,100,104,108,112,115,119,123,127,131],{"path":63,"resourceType":64,"resourceTypeDesc":65,"sizeBytes":66,"sourceHtmlUrl":67},"eval\u002Ftest-cases.yaml","REFERENCE","参考文档",9500,"https:\u002F\u002Fgithub.com\u002Fjhkchan\u002Faws-agent-skills\u002Fblob\u002Fmain\u002Fskills\u002Fautoscaling-group-auditor\u002Feval\u002Ftest-cases.yaml",{"path":69,"resourceType":64,"resourceTypeDesc":65,"sizeBytes":70,"sourceHtmlUrl":71},"evals\u002Fbaselines\u002Fec2-check-elb-attached.md",602,"https:\u002F\u002Fgithub.com\u002Fjhkchan\u002Faws-agent-skills\u002Fblob\u002Fmain\u002Fskills\u002Fautoscaling-group-auditor\u002Fevals\u002Fbaselines\u002Fec2-check-elb-attached.md",{"path":73,"resourceType":64,"resourceTypeDesc":65,"sizeBytes":74,"sourceHtmlUrl":75},"evals\u002Fbaselines\u002Felb-healthcheck-no-targetgroup.md",775,"https:\u002F\u002Fgithub.com\u002Fjhkchan\u002Faws-agent-skills\u002Fblob\u002Fmain\u002Fskills\u002Fautoscaling-group-auditor\u002Fevals\u002Fbaselines\u002Felb-healthcheck-no-targetgroup.md",{"path":77,"resourceType":64,"resourceTypeDesc":65,"sizeBytes":78,"sourceHtmlUrl":79},"evals\u002Fbaselines\u002Fimdsv2-gap-short-grace.md",612,"https:\u002F\u002Fgithub.com\u002Fjhkchan\u002Faws-agent-skills\u002Fblob\u002Fmain\u002Fskills\u002Fautoscaling-group-auditor\u002Fevals\u002Fbaselines\u002Fimdsv2-gap-short-grace.md",{"path":81,"resourceType":64,"resourceTypeDesc":65,"sizeBytes":82,"sourceHtmlUrl":83},"evals\u002Fbaselines\u002Flegacy-launch-config-desired-over-max.md",549,"https:\u002F\u002Fgithub.com\u002Fjhkchan\u002Faws-agent-skills\u002Fblob\u002Fmain\u002Fskills\u002Fautoscaling-group-auditor\u002Fevals\u002Fbaselines\u002Flegacy-launch-config-desired-over-max.md",{"path":85,"resourceType":64,"resourceTypeDesc":65,"sizeBytes":86,"sourceHtmlUrl":87},"evals\u002Fbaselines\u002Fspot-single-instance-type.md",541,"https:\u002F\u002Fgithub.com\u002Fjhkchan\u002Faws-agent-skills\u002Fblob\u002Fmain\u002Fskills\u002Fautoscaling-group-auditor\u002Fevals\u002Fbaselines\u002Fspot-single-instance-type.md",{"path":89,"resourceType":64,"resourceTypeDesc":65,"sizeBytes":90,"sourceHtmlUrl":91},"evals\u002Fbaselines\u002Fwell-configured-production-asg.md",606,"https:\u002F\u002Fgithub.com\u002Fjhkchan\u002Faws-agent-skills\u002Fblob\u002Fmain\u002Fskills\u002Fautoscaling-group-auditor\u002Fevals\u002Fbaselines\u002Fwell-configured-production-asg.md",{"path":93,"resourceType":64,"resourceTypeDesc":65,"sizeBytes":94,"sourceHtmlUrl":95},"evals\u002Feval_config.yaml",1976,"https:\u002F\u002Fgithub.com\u002Fjhkchan\u002Faws-agent-skills\u002Fblob\u002Fmain\u002Fskills\u002Fautoscaling-group-auditor\u002Fevals\u002Feval_config.yaml",{"path":97,"resourceType":64,"resourceTypeDesc":65,"sizeBytes":98,"sourceHtmlUrl":99},"evals\u002Fevals.json",4928,"https:\u002F\u002Fgithub.com\u002Fjhkchan\u002Faws-agent-skills\u002Fblob\u002Fmain\u002Fskills\u002Fautoscaling-group-auditor\u002Fevals\u002Fevals.json",{"path":101,"resourceType":64,"resourceTypeDesc":65,"sizeBytes":102,"sourceHtmlUrl":103},"evals\u002Fprompts\u002Fec2-check-elb-attached.md",735,"https:\u002F\u002Fgithub.com\u002Fjhkchan\u002Faws-agent-skills\u002Fblob\u002Fmain\u002Fskills\u002Fautoscaling-group-auditor\u002Fevals\u002Fprompts\u002Fec2-check-elb-attached.md",{"path":105,"resourceType":64,"resourceTypeDesc":65,"sizeBytes":106,"sourceHtmlUrl":107},"evals\u002Fprompts\u002Felb-healthcheck-no-targetgroup.md",682,"https:\u002F\u002Fgithub.com\u002Fjhkchan\u002Faws-agent-skills\u002Fblob\u002Fmain\u002Fskills\u002Fautoscaling-group-auditor\u002Fevals\u002Fprompts\u002Felb-healthcheck-no-targetgroup.md",{"path":109,"resourceType":64,"resourceTypeDesc":65,"sizeBytes":110,"sourceHtmlUrl":111},"evals\u002Fprompts\u002Fimdsv2-gap-short-grace.md",1144,"https:\u002F\u002Fgithub.com\u002Fjhkchan\u002Faws-agent-skills\u002Fblob\u002Fmain\u002Fskills\u002Fautoscaling-group-auditor\u002Fevals\u002Fprompts\u002Fimdsv2-gap-short-grace.md",{"path":113,"resourceType":64,"resourceTypeDesc":65,"sizeBytes":90,"sourceHtmlUrl":114},"evals\u002Fprompts\u002Flegacy-launch-config-desired-over-max.md","https:\u002F\u002Fgithub.com\u002Fjhkchan\u002Faws-agent-skills\u002Fblob\u002Fmain\u002Fskills\u002Fautoscaling-group-auditor\u002Fevals\u002Fprompts\u002Flegacy-launch-config-desired-over-max.md",{"path":116,"resourceType":64,"resourceTypeDesc":65,"sizeBytes":117,"sourceHtmlUrl":118},"evals\u002Fprompts\u002Fspot-single-instance-type.md",1025,"https:\u002F\u002Fgithub.com\u002Fjhkchan\u002Faws-agent-skills\u002Fblob\u002Fmain\u002Fskills\u002Fautoscaling-group-auditor\u002Fevals\u002Fprompts\u002Fspot-single-instance-type.md",{"path":120,"resourceType":64,"resourceTypeDesc":65,"sizeBytes":121,"sourceHtmlUrl":122},"evals\u002Fprompts\u002Fwell-configured-production-asg.md",1210,"https:\u002F\u002Fgithub.com\u002Fjhkchan\u002Faws-agent-skills\u002Fblob\u002Fmain\u002Fskills\u002Fautoscaling-group-auditor\u002Fevals\u002Fprompts\u002Fwell-configured-production-asg.md",{"path":124,"resourceType":64,"resourceTypeDesc":65,"sizeBytes":125,"sourceHtmlUrl":126},"examples\u002Fend-to-end.md",5040,"https:\u002F\u002Fgithub.com\u002Fjhkchan\u002Faws-agent-skills\u002Fblob\u002Fmain\u002Fskills\u002Fautoscaling-group-auditor\u002Fexamples\u002Fend-to-end.md",{"path":128,"resourceType":64,"resourceTypeDesc":65,"sizeBytes":129,"sourceHtmlUrl":130},"references\u002Fadvanced-patterns.md",11676,"https:\u002F\u002Fgithub.com\u002Fjhkchan\u002Faws-agent-skills\u002Fblob\u002Fmain\u002Fskills\u002Fautoscaling-group-auditor\u002Freferences\u002Fadvanced-patterns.md",{"path":132,"resourceType":64,"resourceTypeDesc":65,"sizeBytes":133,"sourceHtmlUrl":134},"skill.usf.yaml",4084,"https:\u002F\u002Fgithub.com\u002Fjhkchan\u002Faws-agent-skills\u002Fblob\u002Fmain\u002Fskills\u002Fautoscaling-group-auditor\u002Fskill.usf.yaml",[136,143,150,157,164,171],{"skillNo":137,"name":138,"nameZh":6,"description":139,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":140,"categories":141,"keywords":142,"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":144,"name":145,"nameZh":6,"description":146,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":147,"categories":148,"keywords":149,"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":151,"name":152,"nameZh":6,"description":153,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":154,"categories":155,"keywords":156,"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":158,"name":159,"nameZh":6,"description":160,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":161,"categories":162,"keywords":163,"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":165,"name":166,"nameZh":6,"description":167,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":168,"categories":169,"keywords":170,"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":172,"name":173,"nameZh":6,"description":174,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":175,"categories":176,"keywords":177,"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",[],[]]