[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M7AA937ZBMA0FCB7Y9DXMAJW":3,"skill-same:01M7AA937ZBMA0FCB7Y9DXMAJW":153},{"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":45,"commitSha":46,"skillDirectory":47,"forksCount":48,"repositoryHtmlUrl":49,"repositoryHomepageUrl":6,"ownerHtmlUrl":50,"ownerBlogUrl":6,"ownerDescription":51,"updatedAt":52,"install":53,"resources":66},"01M7AA937ZBMA0FCB7Y9DXMAJW","nat-gateway-cost-optimizer",null,"Optimises NAT Gateway cost through traffic analysis, VPC endpoint design, and architecture selection. Identifies avoidable AWS-service traffic (S3, DynamoDB via FREE Gateway endpoints; ECR, SSM, STS, Secrets Manager, CloudWatch, KMS via Interface endpoints), runs break-even maths on interface endpoints (~160 GB\u002Fmonth threshold at $0.045\u002FGB NAT vs $0.01\u002FGB endpoint), selects single vs multi-AZ NAT topology by environment, evaluates NAT Instance alternatives for dev\u002Ftest, and emits a deterministic verdict (OPTIMIZED | OPPORTUNITY_FOUND | ALREADY_OPTIMAL) per VPC with the exact endpoint-creation payload and estimated monthly savings. Use when reviewing NAT Gateway spend, triaging unexpected data-processing charges, planning a FinOps VPC endpoint rollout, or deciding between NAT Gateway and NAT Instance for a non-HA workload.","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\u002Fnat-gateway-cost-optimizer\u002FSKILL.md",[],[],"2026-11-15 14:19:17",false,"---\nname: nat-gateway-cost-optimizer\ndescription: Optimises NAT Gateway cost through traffic analysis, VPC endpoint design, and architecture selection. Identifies avoidable AWS-service traffic (S3, DynamoDB via FREE Gateway endpoints; ECR, SSM, STS, Secrets Manager, CloudWatch, KMS via Interface endpoints), runs break-even maths on interface endpoints (~160 GB\u002Fmonth threshold at $0.045\u002FGB NAT vs $0.01\u002FGB endpoint), selects single vs multi-AZ NAT topology by environment, evaluates NAT Instance alternatives for dev\u002Ftest, and emits a deterministic verdict (OPTIMIZED | OPPORTUNITY_FOUND | ALREADY_OPTIMAL) per VPC with the exact endpoint-creation payload and estimated monthly savings. Use when reviewing NAT Gateway spend, triaging unexpected data-processing charges, planning a FinOps VPC endpoint rollout, or deciding between NAT Gateway and NAT Instance for a non-HA workload.\nlicense: Apache-2.0\ncompatibility: Agent runtime that reads SKILL.md (Claude Code, Cursor, Windsurf, Codex, Gemini). Offline configuration classification works from pasted VPC topology, Cost Explorer data, and VPC Flow Logs summaries. Live-account optimisation uses aws ec2 describe-nat-gateways, aws ec2 describe-vpc-endpoints, aws ce get-cost-and-usage with filter for NatGateway usage type, aws ec2 describe-route-tables, and aws logs start-query for VPC Flow Logs traffic breakdown (AWS CLI v2, SSO or key-based credentials)...\nmetadata:\n  domain: aws-cloudops\n  complexity: medium\n  requires_llm: 'true'\n  phase: '3'\n  supports_pipeline: 'true'\n  entry_point: 'false'\n  family: FinOps\n  task_type: optimize\n  skill_class: capability\n  lifecycle_status: active\n  verdict_shape: OPTIMIZED | OPPORTUNITY_FOUND | ALREADY_OPTIMAL\n  when_to_use: Reviewing NAT Gateway spend, triaging unexpected AWS data-processing charges, designing a VPC endpoint rollout, deciding between single vs multi-AZ NAT topology, evaluating NAT Instance for dev\u002Ftest, or building a networking FinOps plan.\n  when_not_to_use: Auditing Transit Gateway routing (use the networking auditor), VPC peering topology design (architectural, not cost-driven), Direct Connect procurement, or Security Group rule review. This skill focuses on NAT Gateway cost reduction via VPC endpoints and topology choice, not on connectivity troubleshooting or route-table correctness audits.\n  activation_triggers: optimise NAT Gateway cost, NAT Gateway data processing charge, VPC endpoint cost benefit, S3 traffic through NAT, create Gateway VPC Endpoint, single NAT Gateway vs multi-AZ, NAT Instance alternative, reduce NAT Gateway bill, VPC Flow Logs traffic breakdown, FinOps networking review, PrivateLink endpoint savings, ECR traffic through NAT, DynamoDB VPC endpoint, unexpected AWS data transfer charge\n  invocation_schema: 'Input: either (a) a VPC configuration (NAT Gateways, route tables, VPC endpoints, subnet-to-AZ mapping, monthly data-processing GB from Cost Explorer), OR (b) a VPC ID for live-account optimisation. Output: a deterministic VPC\u002FVERDICT\u002FREASON\u002FRECOMMENDATION\u002FSAVINGS\u002FIMPLEMENTATION block per VPC, where VERDICT is one of OPTIMIZED, OPPORTUNITY_FOUND, ALREADY_OPTIMAL.'\n  invocation_example: \"# Minimal valid input (offline classification):\\nVPC: vpc-0abc123\\nRegion: us-east-1\\nEnvironment: production\\nNAT Gateways: 3 (one per AZ — us-east-1a, 1b, 1c)\\nData processing (last 30 days, Cost Explorer): 2,400 GB total\\nCurrent VPC Endpoints: none\\nTraffic breakdown (VPC Flow Logs, last 7 days):\\n  - S3: 900 GB\u002Fmonth\\n  - DynamoDB: 200 GB\u002Fmonth\\n  - ECR: 150 GB\u002Fmonth\\n  - Other AWS services: 150 GB\u002Fmonth\\n  - Internet (non-AWS): 1,000 GB\u002Fmonth\\nEmit the standard optimization block (VPC, VERDICT, REASON,\\nRECOMMENDATION, SAVINGS, IMPLEMENTATION).\"\n  version: 0.1.0\n  author: Jacky Chan — AWS Community Builder\n  keywords: NAT Gateway, VPC Endpoint, Gateway Endpoint, Interface Endpoint, PrivateLink, S3 Gateway Endpoint, DynamoDB Gateway Endpoint, ECR endpoint, SSM endpoint, STS endpoint, Secrets Manager endpoint, data processing charge, cost optimization, FinOps, NAT Instance, cross-AZ data transfer, VPC Flow Logs, Cost Explorer, AWS PrivateLink\n  tags: nat-gateway, vpc, networking, cost-optimization, finops, vpc-endpoint, privatelink\n---\n\n# NAT Gateway Cost Optimizer\n\n## What this skill does\n\nTranslates NAT Gateway spend into a concrete VPC endpoint rollout plan and\na dollar-denominated savings estimate. NAT Gateway is the #1 source of\nunexpected AWS bills: every GB processed costs $0.045, and the most common\nsources of that traffic (S3, DynamoDB) can be redirected to **free** Gateway\nVPC Endpoints. The verdict is the **highest-leverage action** across four\ndimensions — Gateway endpoints (free), Interface endpoints (break-even\nanalysis), NAT topology (single vs multi-AZ), and NAT Instance substitution\n(dev\u002Ftest) — applied in priority order. Always pairs the recommendation with\nthe exact `create-vpc-endpoint` payload so the operator can paste, review,\nand apply.\n\n## Quick reference — verdict thresholds\n\n| Verdict | Trigger condition | Action |\n|---|---|---|\n| `OPPORTUNITY_FOUND` | One or more dimensions has a cost-saving endpoint or topology change available | Emit recommended endpoints\u002Ftopology + savings estimate |\n| `OPTIMIZED` | An endpoint or topology change was applied this session and verified | Emit post-state verification and recompute savings |\n| `ALREADY_OPTIMAL` | All applicable Gateway endpoints exist, Interface endpoints above break-even are in place, topology matches environment | No action — confirm posture |\n\n**Priority order for opportunity dimensions (apply in this sequence, aggregate\nall that apply into a single recommendation):**\n\n1. **Gateway endpoints for S3 and DynamoDB** — FREE, always create them if\n   any S3\u002FDynamoDB traffic flows through NAT. This is the single largest\n   quick win on most AWS accounts.\n2. **Interface endpoints for high-traffic AWS services** (ECR, SSM, STS,\n   Secrets Manager, CloudWatch, KMS) — apply break-even maths; recommend if\n   monthly traffic > ~160 GB.\n3. **NAT topology** — single NAT Gateway for non-prod (saves base hourly\n   cost), one per AZ for prod (avoids cross-AZ transfer).\n4. **NAT Instance substitution** — dev\u002Ftest workloads where HA is not\n   required; fixed EC2 cost instead of per-GB processing.\n\n> Pricing detail moved to [references\u002Fvpc-endpoint-pricing-matrix.md](references\u002Fvpc-endpoint-pricing-matrix.md): full us-east-1 cost-baseline table.\n> Load on demand when break-even maths needs component rates; the rule of thumb below stays authoritative.\n\n**Break-even rule of thumb:** for an Interface endpoint, monthly savings =\n`(GB × $0.045) − (GB × $0.01 + $7.30 × num_AZs)`. The break-even point is\n~**160 GB\u002Fmonth per AZ** of traffic to the target service.\n\n## Mindset and philosophy\n\n**One-line takeaway:** Gateway endpoints (S3, DynamoDB) are free and should\nexist on every VPC that has a NAT Gateway — their absence is a defect, not\nan optimisation opportunity. Four networking realities drive the verdict:\n\n> The four networking realities behind this mindset are expanded in [references\u002Fexpert-knowledge.md](references\u002Fexpert-knowledge.md).\n> Load on demand for the full treatment of each reality before issuing a verdict.\n\n## Pre-flight: VPC metadata gate\n\n> Full pre-flight command listing (NAT enumeration, endpoints, Cost Explorer, Flow Logs, route tables, data-quality short-circuits) moved to [references\u002Fdiagnostic-commands.md](references\u002Fdiagnostic-commands.md).\n> Run every check there before classification — misclassifying these produces false positives.\n\n## Process — optimisation logic (apply in order, aggregate all applicable)\n\n### Step 0: Expert knowledge — non-obvious NAT Gateway and VPC endpoint behaviours\n\n> Step-0 expert-knowledge summary moved to [references\u002Fexpert-knowledge.md](references\u002Fexpert-knowledge.md) (non-obvious NAT Gateway and VPC endpoint behaviours).\n> Load on demand; each behaviour changes a recommendation if ignored.\n\n### Step 1: Gateway endpoints for S3 and DynamoDB (FREE — always create)\n\nIf ANY S3 or DynamoDB traffic flows through the NAT Gateway and the\ncorresponding Gateway endpoint does not exist:\n\n**Pattern — S3 Gateway Endpoint:**\n```bash\naws ec2 create-vpc-endpoint \\\n  --vpc-id \u003Cvpc-id> \\\n  --service-name com.amazonaws.us-east-1.s3 \\\n  --vpc-endpoint-type Gateway \\\n  --route-table-ids \u003Crtb-id-1> \u003Crtb-id-2> \\\n  --output json\n```\n\n**Pattern — DynamoDB Gateway Endpoint:**\n```bash\naws ec2 create-vpc-endpoint \\\n  --vpc-id \u003Cvpc-id> \\\n  --service-name com.amazonaws.us-east-1.dynamodb \\\n  --vpc-endpoint-type Gateway \\\n  --route-table-ids \u003Crtb-id-1> \u003Crtb-id-2> \\\n  --output json\n```\n\n**Savings estimate:**\n```\nS3 savings   = S3_GB_through_NAT × $0.045\nDynamoDB savings = DDB_GB_through_NAT × $0.045\n```\n\nThese savings are captured in FULL — Gateway endpoints are free, so every\ndollar of redirected traffic is a dollar saved. There is no break-even\nthreshold.\n\nIf S3 or DynamoDB traffic exists and the Gateway endpoint is absent:\n**OPPORTUNITY_FOUND** on this dimension. This is the single highest-leverage\nrecommendation the skill can make.\n\n### Step 2: Interface endpoints for high-traffic AWS services (break-even analysis)\n\nFor each AWS service with significant traffic through NAT (ECR, SSM, STS,\nSecrets Manager, CloudWatch, KMS, CodeArtifact, etc.), compute the break-even:\n\n```\nMonthly savings = (service_GB × $0.045) − (service_GB × $0.01 + $7.30 × num_AZs)\n```\n\n**Decision matrix:**\n\n| Monthly traffic to service | Verdict | Recommendation |\n|---|---|---|\n| > 200 GB\u002Fmonth (> break-even) | **OPPORTUNITY_FOUND** | Create Interface endpoint in the AZs that originate the traffic |\n| 100-200 GB\u002Fmonth (near break-even) | **OPPORTUNITY_FOUND** (MEDIUM confidence) | Create Interface endpoint in 1-2 AZs; monitor for 30 days |\n| \u003C 100 GB\u002Fmonth (\u003C break-even) | Skip (ALREADY_OPTIMAL for this service) | Do NOT create — endpoint would increase cost |\n\n**Pattern — ECR Interface Endpoint (most common high-traffic candidate):**\n```bash\naws ec2 create-vpc-endpoint \\\n  --vpc-id \u003Cvpc-id> \\\n  --vpc-endpoint-type Interface \\\n  --service-name com.amazonaws.us-east-1.ecr.api \\\n  --subnet-ids \u003Csubnet-1a> \u003Csubnet-1b> \\\n  --security-group-ids \u003Csg-id> \\\n  --private-dns-enabled \\\n  --output json\n\n# Also create the ecr.dkr endpoint for Docker pull\u002Fpush (separate service name)\naws ec2 create-vpc-endpoint \\\n  --vpc-id \u003Cvpc-id> \\\n  --vpc-endpoint-type Interface \\\n  --service-name com.amazonaws.us-east-1.ecr.dkr \\\n  --subnet-ids \u003Csubnet-1a> \u003Csubnet-1b> \\\n  --security-group-ids \u003Csg-id> \\\n  --private-dns-enabled \\\n  --output json\n```\n\n**Common Interface endpoint candidates and their typical break-even:**\n\n| Service | Service name suffix | Typical traffic pattern | Break-even GB\u002Fmonth (per AZ) |\n|---|---|---|---|\n| ECR (api + dkr) | ecr.api, ecr.dkr | Container image pulls\u002Fpushes | ~160 GB (note: TWO endpoints needed) |\n| SSM | ssm | Systems Manager agent check-ins | Low (usually skip) |\n| STS | sts | AssumeRole calls | Very low (skip) |\n| Secrets Manager | secretsmanager | App secret fetches | Low unless high-frequency rotation |\n| CloudWatch Logs | logs | Application log shipping | High if logs are verbose; evaluate |\n| KMS | kms | Encrypt\u002Fdecrypt API calls | Low (skip) |\n| CodeArtifact | codeartifact.api | Package pulls | Medium; evaluate by CI volume |\n\n### Step 3: NAT topology optimisation (single vs multi-AZ)\n\nThe topology decision depends on the environment AND the cross-AZ traffic\nvolume.\n\n**Decision matrix:**\n\n| Environment | Cross-AZ traffic volume | Recommendation |\n|---|---|---|\n| Production, high throughput (> 500 GB\u002Fmonth cross-AZ) | High | Keep one NAT Gateway per AZ — cross-AZ transfer would exceed the base-cost saving |\n| Production, low throughput (\u003C 100 GB\u002Fmonth cross-AZ) | Low | Consolidate to a single NAT Gateway — base-cost saving exceeds cross-AZ transfer |\n| Non-production (dev\u002Ftest\u002Fstaging) | Any | Single NAT Gateway — accept cross-AZ cost; HA is not required |\n| Non-production, minimal outbound (\u003C 10 GB\u002Fmonth) | Very low | Consider NAT Instance (Step 4) instead |\n\n**Cross-AZ cost calculation for single-NAT topology:**\n```\nCross-AZ cost = total_GB_from_other_AZs × $0.02  (both directions)\nBase saving = (eliminated_gateways × $32.85)\nNet = base_saving − cross_AZ_cost\n```\n\nIf `Net > 0`, single-NAT is cheaper. If `Net \u003C 0`, keep multi-NAT.\n\n**Pattern — consolidate to single NAT Gateway (non-prod):**\n1. Update route tables in all private subnets to point `0.0.0.0\u002F0` to the\n   single remaining NAT Gateway.\n2. Delete the redundant NAT Gateways:\n   `aws ec2 delete-nat-gateway --nat-gateway-id \u003Cid>`.\n3. Release the Elastic IPs:\n   `aws ec2 release-address --allocation-id \u003Ceip-alloc-id>`.\n\n### Step 4: NAT Instance substitution (dev\u002Ftest only)\n\nFor dev\u002Ftest environments with minimal outbound traffic and no HA requirement:\n\n**Pattern — NAT Instance (t3.micro, dev\u002Ftest):**\n```bash\n# Launch a NAT Instance from the public AMI (search for the latest amzn-ami-vpc-nat AMI)\naws ec2 run-instances \\\n  --image-id resolve:ssm:\u002Faws\u002Fservice\u002Fami-amazon-linux-latest\u002Famzn-ami-vpc-nat-hvm \\\n  --instance-type t3.micro \\\n  --subnet-id \u003Cpublic-subnet> \\\n  --associate-public-ip-address \\\n  --tag-specifications \"ResourceType=instance,Tags=[{Key=Name,Value=nat-instance-dev}]\" \\\n  --output json\n\n# Disable source\u002Fdestination checks (required for NAT function)\naws ec2 modify-instance-attribute --instance-id \u003Cid> --no-source-dest-check\n\n# Update route tables to point to the instance instead of the NAT Gateway\naws ec2 replace-route --route-table-id \u003Crtb-id> \\\n  --destination-cidr-block 0.0.0.0\u002F0 --instance-id \u003Cid>\n```\n\n**Savings estimate:**\n```\nNAT Gateway cost = $32.85 (base) + (GB × $0.045)\nNAT Instance cost = $8.47 (t3.micro, flat) + (GB × $0)  [no per-GB charge]\nSaving = NAT_Gateway_cost − $8.47\n```\n\n**Reliability warning (MUST surface in output):**\n- NAT Instance is a single point of failure — no SLA, no automatic failover.\n- Bandwidth is capped by instance type (~1 Gbps for t3.micro).\n- If the underlying host fails, outbound traffic stops until the instance is\n  replaced (manual or via Auto Scaling recovery, which adds 2-5 minutes of\n  downtime).\n- NOT suitable for production workloads.\n\n### Step 5: Aggregation — emit the highest-leverage recommendation\n\nAggregate ALL applicable dimensions into a single recommendation. The verdict\nis `OPPORTUNITY_FOUND` if any dimension has a saving. The recommendation\nincludes the full endpoint-creation and topology-change plan.\n\nIf no dimension has an opportunity (all applicable Gateway endpoints exist,\nInterface endpoints are above break-even where justified, topology matches\nenvironment): **ALREADY_OPTIMAL**.\n\nIf the recommendation was applied this session and verified: **OPTIMIZED**.\n\n## Output format (per VPC)\n\n```text\nVPC: \u003Cvpc-id>\nVERDICT: OPTIMIZED | OPPORTUNITY_FOUND | ALREADY_OPTIMAL\nREASON: \u003C1-2 sentences citing the highest-leverage dimension and step number>\nRECOMMENDATION:\n  \u003Clist of endpoint-creation and topology-change actions>\nSAVINGS:\n  CURRENT_MONTHLY: $\u003CX.XX>\n  PROJECTED_MONTHLY: $\u003CY.YY>\n  MONTHLY_SAVING: $\u003CX.XX - Y.YY>\n  ANNUAL_SAVING: $\u003C12 × monthly>\n  CAVEATS: \u003CInterface endpoint break-even assumptions, NAT Instance reliability warnings>\nIMPLEMENTATION:\n  1. \u003Ccreate-vpc-endpoint CLI command>\n  2. \u003Cdelete-nat-gateway CLI command>\n  3. \u003Cverification command>\n```\n\n### Worked examples (see references\u002Fworked-examples.md)\n\n> Secondary worked examples moved to [references\u002Fworked-examples.md](references\u002Fworked-examples.md) — three full end-to-end scenarios.\n> Load on demand; the primary example under the STRICT output contract below stays in this file.\n\n## STRICT output contract\n\nThe rules below are hard constraints. Violating any one produces an\narithmetic contradiction or a misclassification that breaks downstream\nFinOps automation. Self-check EVERY emitted block against these rules\nbefore returning the response.\n\n### Required output structure\n\nEvery response MUST be a single block per VPC using these literal\nlabels, in this order. Do NOT substitute markdown headings, camelCase,\nor bold variants.\n\n```text\nVPC: \u003Cvpc-id>\nVERDICT: OPTIMIZED | OPPORTUNITY_FOUND | ALREADY_OPTIMAL\nREASON: \u003C1-2 sentences citing the highest-leverage dimension and step number>\nRECOMMENDATION:\n  \u003Clist of endpoint-creation and topology-change actions>\nSAVINGS:\n  CURRENT_MONTHLY: $\u003Camount>    ← MUST show base + data-processing subtotals\n  PROJECTED_MONTHLY: $\u003Camount>\n  MONTHLY_SAVING: $\u003Camount>     ← MUST equal CURRENT − PROJECTED, 2 decimals\n  ANNUAL_SAVING: $\u003Camount>      ← MUST equal MONTHLY × 12\n  CAVEATS: \u003Cbreak-even assumptions, reliability warnings>\nIMPLEMENTATION:\n  1. \u003Ccreate-vpc-endpoint \u002F delete-nat-gateway \u002F replace-route CLI command>\n  2. \u003Cverification command>\n```\n\n### FORBIDDEN output patterns\n\n1. **NEVER emit `VERDICT: OPPORTUNITY_FOUND` with\n   `MONTHLY_SAVING: $0.00`.** If every dimension nets zero saving, the\n   verdict MUST be `ALREADY_OPTIMAL`. An `OPPORTUNITY_FOUND` block with\n   a zero savings line is a direct contradiction.\n\n2. **NEVER show a savings figure where `CURRENT_MONTHLY −\n   PROJECTED_MONTHLY` does not equal `MONTHLY_SAVING`.** Round both\n   sides to 2 decimal places. If they differ, fix the arithmetic before\n   emitting — do NOT append an \"Adjusted to Cost Explorer baseline\" or\n   \"rounding\" reconciliation that masks the mismatch.\n\n3. **NEVER recommend an Interface endpoint without citing the GB\u002Fmonth\n   traffic volume AND the break-even threshold (~160 GB\u002Fmonth per AZ).**\n   The RECOMMENDATION line MUST state: `\u003Cservice>: \u003CX> GB\u002Fmonth vs\n   \u003Cbreak-even> GB\u002Fmonth break-even for \u003CN>-AZ`. An Interface endpoint\n   on traffic below break-even INCREASES cost — that is a negative\n   saving and MUST NOT appear as `OPPORTUNITY_FOUND`.\n\n4. **NEVER include Gateway endpoint (S3, DynamoDB) costs on the cost\n   side of the SAVINGS equation.** Gateway endpoints are free — $0\n   hourly, $0 per-GB. Their absence from a VPC with S3\u002FDynamoDB NAT\n   traffic is always `OPPORTUNITY_FOUND` with the full redirected-GB\n   dollar amount captured as saving.\n\n5. **NEVER recommend a NAT Instance without the reliability warning in\n   CAVEATS.** The warning MUST include: \"single point of failure, no\n   SLA, not suitable for production.\" A NAT Instance recommendation\n   without this caveat is non-compliant.\n\n6. **NEVER emit a \"NOTE: discrepancy due to partial-month data\" or\n   \"Adjusted to Cost Explorer baseline ratio\" line that reconciles\n   arithmetic errors.** If Cost Explorer shows a different figure than\n   the computed subtotal, use the Cost Explorer figure as\n   `CURRENT_MONTHLY` and recompute `PROJECTED_MONTHLY` from it\n   proportionally. The two MUST reconcile without a narrative patch.\n\n7. **NEVER recommend deleting a NAT Gateway without pairing the\n   deletion with `aws ec2 release-address` for the associated EIP.**\n   An unreleased EIP incurs $3.65\u002Fmonth indefinitely — the\n   IMPLEMENTATION block MUST include the release-address step.\n\n8. **NEVER aggregate traffic across services to hit a single Interface\n   endpoint break-even.** Each Interface endpoint is a separate\n   financial decision with its own break-even. S3 (100 GB) + ECR (60\n   GB) does NOT justify an ECR endpoint at 160 GB.\n\n### Perfect example output — OPPORTUNITY_FOUND with verified math\n\nEvery field below is internally consistent. Copy this shape exactly.\n\n```text\nVPC: vpc-0abc123\nVERDICT: OPPORTUNITY_FOUND\nREASON: 3-AZ production VPC with 3 NAT Gateways processing 2,400 GB\u002Fmonth.\n  No Gateway endpoints exist — 900 GB\u002Fmonth S3 + 200 GB\u002Fmonth DynamoDB\n  flow through NAT (Step 1). ECR at 150 GB\u002Fmonth is below 160 GB\u002FAZ\n  break-even (Step 2, skipped). Topology correct for production (Step 3).\nRECOMMENDATION:\n  1. Create S3 Gateway Endpoint (FREE) — reroutes 900 GB\u002Fmonth off NAT.\n  2. Create DynamoDB Gateway Endpoint (FREE) — reroutes 200 GB\u002Fmonth.\n  3. Skip ECR Interface Endpoint: 150 GB \u003C 160 GB break-even for 1-AZ.\n  4. Topology: keep 3 NAT Gateways (production, high throughput).\nSAVINGS:\n  CURRENT_MONTHLY: $206.55\n    NAT base: 3 × $32.85 = $98.55\n    NAT data processing: 2,400 GB × $0.045 = $108.00\n  PROJECTED_MONTHLY: $157.05\n    NAT base: 3 × $32.85 = $98.55 (unchanged)\n    NAT data processing: 1,300 GB × $0.045 = $58.50\n    Gateway endpoints: $0.00 (free)\n  MONTHLY_SAVING: $49.50\n    ($206.55 − $157.05 = $49.50 ✓)\n    (1,100 GB × $0.045 = $49.50 ✓)\n  ANNUAL_SAVING: $594.00\n  CAVEATS:\n    - Gateway endpoints are free — savings captured in full.\n    - ECR Interface endpoint NOT recommended: below break-even.\n    - Cross-region S3 access not covered by regional Gateway endpoint.\nIMPLEMENTATION:\n  1. CONFIRM: Create S3 + DynamoDB Gateway endpoints on vpc-0abc123. Proceed?\n  2. aws ec2 create-vpc-endpoint --vpc-id vpc-0abc123 --service-name com.amazonaws.us-east-1.s3 --vpc-endpoint-type Gateway --route-table-ids rtb-aaa rtb-bbb rtb-ccc\n  3. aws ec2 create-vpc-endpoint --vpc-id vpc-0abc123 --service-name com.amazonaws.us-east-1.dynamodb --vpc-endpoint-type Gateway --route-table-ids rtb-aaa rtb-bbb rtb-ccc\n  4. Verify: aws ec2 describe-vpc-endpoints --filter \"Name=vpc-id,Values=vpc-0abc123\"\n  5. After 24h, re-query Cost Explorer — expect ~$49.50\u002Fmo reduction.\n```\n\n**Self-check before emit:**\n- [ ] `CURRENT_MONTHLY − PROJECTED_MONTHLY == MONTHLY_SAVING` (2 decimals)?\n- [ ] `MONTHLY_SAVING × 12 == ANNUAL_SAVING`?\n- [ ] Every Interface endpoint recommendation cites GB\u002Fmonth vs break-even?\n- [ ] NAT Instance recommendation includes reliability warning?\n- [ ] NAT Gateway deletion paired with `release-address`?\n- [ ] No \"adjusted\" or \"discrepancy\" reconciliation lines?\n\n## Verdict consistency rules (prevent misclassification)\n\nThe skill MUST emit verdicts that are mathematically and logically\nself-consistent:\n\n1. **Zero-savings rule.** If `MONTHLY_SAVING == $0.00` for every dimension,\n   the verdict MUST be `ALREADY_OPTIMAL`, never `OPPORTUNITY_FOUND`.\n\n2. **Negative-savings rule.** If an Interface endpoint would cost MORE than\n   the NAT processing it replaces (traffic below break-even), do NOT recommend\n   it. The verdict for that dimension is \"no action.\" Emitting\n   `OPPORTUNITY_FOUND` with a negative saving is a hard error.\n\n3. **OPPORTUNITY_FOUND requires a non-zero savings line.** When emitting\n   `OPPORTUNITY_FOUND`, the SAVINGS block must show a positive `MONTHLY_SAVING`\n   for at least one dimension.\n\n4. **SAVINGS arithmetic check.** `CURRENT_MONTHLY − PROJECTED_MONTHLY` MUST\n   equal `MONTHLY_SAVING`. Round to 2 decimal places.\n\n5. **Gateway endpoint is always free.** Never include a Gateway endpoint\n   (S3, DynamoDB) in the cost side of the equation. Its absence from a VPC\n   with S3\u002FDynamoDB traffic is always OPPORTUNITY_FOUND.\n\n6. **NAT Instance recommendations MUST include the reliability warning.**\n   A NAT Instance recommendation without the \"single point of failure,\n   not suitable for production\" caveat is non-compliant.\n\n7. **Elastic IP release must accompany NAT Gateway deletion.** A NAT Gateway\n   deletion without `release-address` for the associated EIP leaves a\n   $3.65\u002Fmonth orphan charge.\n\n## Error handling and edge cases (see references\u002Ftroubleshooting.md)\n\n> Error-handling deep dives, API error tables, and edge-case topologies moved to [references\u002Ftroubleshooting.md](references\u002Ftroubleshooting.md).\n> Load on demand when a CLI\u002Fdata-source call fails or the topology is unusual.\n\n## Anti-Patterns — NEVER (top 5)\n\n1. **NEVER recommend an Interface endpoint without quantifying monthly\n   traffic volume.** An Interface endpoint on a low-traffic VPC INCREASES\n   cost by $7.30\u002FAZ\u002Fmonth. Always cite GB\u002Fmonth and confirm it exceeds\n   break-even (~160 GB\u002Fmonth per AZ).\n\n2. **NEVER recommend a NAT Instance for production.** NAT Instance is a\n   single point of failure with no SLA and bandwidth caps. Dev\u002Ftest only.\n   A cost saving that causes a production outage is a net loss.\n\n3. **NEVER delete a NAT Gateway without updating route tables FIRST and\n   pairing deletion with `release-address` for the EIP.** A route still\n   pointing to a deleted gateway black-holes the subnet; an unreleased\n   EIP leaks $3.65\u002Fmonth indefinitely.\n\n4. **NEVER recommend single-NAT topology for production with high\n   cross-AZ traffic without computing cross-AZ transfer cost.** The\n   cross-AZ charge ($0.01\u002FGB each direction) can exceed the base-cost\n   saving of eliminating gateways.\n\n5. **NEVER auto-apply endpoint or topology changes without the CONFIRM\n   gate, and NEVER batch VPC changes.** A wrong route-table update can\n   black-hole an entire VPC's outbound traffic; process one VPC per\n   CONFIRM gate so errors do not cascade.\n\nAdditional NEVER rules (aggregate break-even, cross-region Gateway\ncoverage, S3 Interface vs Gateway, Flow Logs filtering, NAT Instance\nsource\u002Fdest-check) appear in `references\u002Fexpert-knowledge.md` and the\nFORBIDDEN output patterns section above.\n\n## Pre-flight safety checks (run before any remediation CLI)\n\n> Pre-flight safety check listing (CONFIRM gate, route-table backup, state verification, policy review) moved to [references\u002Fdiagnostic-commands.md](references\u002Fdiagnostic-commands.md).\n> Run before any remediation CLI.\n\n## Recent AWS features (2024-2026)\n\n> Recent AWS features (2024-2026) moved to [references\u002Fadvanced-patterns.md](references\u002Fadvanced-patterns.md).\n> Load on demand for newer capabilities that affect endpoint topology and sizing choices.\n\n## Domain\n\nAWS CloudOps \u002F Networking Cost Optimisation & VPC Endpoint Design.\n\n## AWS documentation\n\n- **Amazon VPC User Guide — VPC Endpoints** — https:\u002F\u002Fdocs.aws.amazon.com\u002Fvpc\u002Flatest\u002Fprivatelink\u002Fconcepts.html\n- **AWS PrivateLink** — https:\u002F\u002Faws.amazon.com\u002Fprivatelink\u002F\n- **NAT Gateways** — https:\u002F\u002Fdocs.aws.amazon.com\u002Fvpc\u002Flatest\u002Fuserguide\u002Fvpc-nat-gateway.html\n- **Gateway VPC Endpoints (S3, DynamoDB)** — https:\u002F\u002Fdocs.aws.amazon.com\u002Fvpc\u002Flatest\u002Fprivatelink\u002Fgateway-endpoints.html\n- **Interface VPC Endpoints (PrivateLink)** — https:\u002F\u002Fdocs.aws.amazon.com\u002Fvpc\u002Flatest\u002Fprivatelink\u002Finterface-endpoints.html\n- **VPC Pricing — NAT Gateway** — https:\u002F\u002Faws.amazon.com\u002Fvpc\u002Fpricing\u002F\n- **AWS CLI Command Reference: ec2** — https:\u002F\u002Fdocs.aws.amazon.com\u002Fcli\u002Flatest\u002Freference\u002Fec2\u002F\n- **VPC Flow Logs** — https:\u002F\u002Fdocs.aws.amazon.com\u002Fvpc\u002Flatest\u002Fuserguide\u002Fflow-logs.html\n- **AWS Well-Architected Framework — Cost Optimization** — https:\u002F\u002Fdocs.aws.amazon.com\u002Fwellarchitected\u002Flatest\u002Fcost-optimization-pillar\u002Fwelcome.html\n## References (load on demand)\n\n- [references\u002Fdiagnostic-commands.md](references\u002Fdiagnostic-commands.md) — pre-flight VPC metadata gate commands and pre-flight safety checks.\n- [references\u002Fadvanced-patterns.md](references\u002Fadvanced-patterns.md) — recent AWS features (2024-2026).\n- [references\u002Fexpert-knowledge.md](references\u002Fexpert-knowledge.md) — Step-0 non-obvious behaviours and the four networking realities.\n- [references\u002Ftroubleshooting.md](references\u002Ftroubleshooting.md) — error handling, API error tables, edge cases.\n- [references\u002Fworked-examples.md](references\u002Fworked-examples.md) — three full end-to-end worked examples.\n- [references\u002Fvpc-endpoint-pricing-matrix.md](references\u002Fvpc-endpoint-pricing-matrix.md) — detailed pricing matrix and cost baseline.\n\n","# NAT Gateway Cost Optimizer\n\n## What this skill does\n\nTranslates NAT Gateway spend into a concrete VPC endpoint rollout plan and\na dollar-denominated savings estimate. NAT Gateway is the #1 source of\nunexpected AWS bills: every GB processed costs $0.045, and the most common\nsources of that traffic (S3, DynamoDB) can be redirected to **free** Gateway\nVPC Endpoints. The verdict is the **highest-leverage action** across four\ndimensions — Gateway endpoints (free), Interface endpoints (break-even\nanalysis), NAT topology (single vs multi-AZ), and NAT Instance substitution\n(dev\u002Ftest) — applied in priority order. Always pairs the recommendation with\nthe exact `create-vpc-endpoint` payload so the operator can paste, review,\nand apply.\n\n## Quick reference — verdict thresholds\n\n| Verdict | Trigger condition | Action |\n|---|---|---|\n| `OPPORTUNITY_FOUND` | One or more dimensions has a cost-saving endpoint or topology change available | Emit recommended endpoints\u002Ftopology + savings estimate |\n| `OPTIMIZED` | An endpoint or topology change was applied this session and verified | Emit post-state verification and recompute savings |\n| `ALREADY_OPTIMAL` | All applicable Gateway endpoints exist, Interface endpoints above break-even are in place, topology matches environment | No action — confirm posture |\n\n**Priority order for opportunity dimensions (apply in this sequence, aggregate\nall that apply into a single recommendation):**\n\n1. **Gateway endpoints for S3 and DynamoDB** — FREE, always create them if\n   any S3\u002FDynamoDB traffic flows through NAT. This is the single largest\n   quick win on most AWS accounts.\n2. **Interface endpoints for high-traffic AWS services** (ECR, SSM, STS,\n   Secrets Manager, CloudWatch, KMS) — apply break-even maths; recommend if\n   monthly traffic > ~160 GB.\n3. **NAT topology** — single NAT Gateway for non-prod (saves base hourly\n   cost), one per AZ for prod (avoids cross-AZ transfer).\n4. **NAT Instance substitution** — dev\u002Ftest workloads where HA is not\n   required; fixed EC2 cost instead of per-GB processing.\n\n> Pricing detail moved to [references\u002Fvpc-endpoint-pricing-matrix.md](references\u002Fvpc-endpoint-pricing-matrix.md): full us-east-1 cost-baseline table.\n> Load on demand when break-even maths needs component rates; the rule of thumb below stays authoritative.\n\n**Break-even rule of thumb:** for an Interface endpoint, monthly savings =\n`(GB × $0.045) − (GB × $0.01 + $7.30 × num_AZs)`. The break-even point is\n~**160 GB\u002Fmonth per AZ** of traffic to the target service.\n\n## Mindset and philosophy\n\n**One-line takeaway:** Gateway endpoints (S3, DynamoDB) are free and should\nexist on every VPC that has a NAT Gateway — their absence is a defect, not\nan optimisation opportunity. Four networking realities drive the verdict:\n\n> The four networking realities behind this mindset are expanded in [references\u002Fexpert-knowledge.md](references\u002Fexpert-knowledge.md).\n> Load on demand for the full treatment of each reality before issuing a verdict.\n\n## Pre-flight: VPC metadata gate\n\n> Full pre-flight command listing (NAT enumeration, endpoints, Cost Explorer, Flow Logs, route tables, data-quality short-circuits) moved to [references\u002Fdiagnostic-commands.md](references\u002Fdiagnostic-commands.md).\n> Run every check there before classification — misclassifying these produces false positives.\n\n## Process — optimisation logic (apply in order, aggregate all applicable)\n\n### Step 0: Expert knowledge — non-obvious NAT Gateway and VPC endpoint behaviours\n\n> Step-0 expert-knowledge summary moved to [references\u002Fexpert-knowledge.md](references\u002Fexpert-knowledge.md) (non-obvious NAT Gateway and VPC endpoint behaviours).\n> Load on demand; each behaviour changes a recommendation if ignored.\n\n### Step 1: Gateway endpoints for S3 and DynamoDB (FREE — always create)\n\nIf ANY S3 or DynamoDB traffic flows through the NAT Gateway and the\ncorresponding Gateway endpoint does not exist:\n\n**Pattern — S3 Gateway Endpoint:**\n```bash\naws ec2 create-vpc-endpoint \\\n  --vpc-id \u003Cvpc-id> \\\n  --service-name com.amazonaws.us-east-1.s3 \\\n  --vpc-endpoint-type Gateway \\\n  --route-table-ids \u003Crtb-id-1> \u003Crtb-id-2> \\\n  --output json\n```\n\n**Pattern — DynamoDB Gateway Endpoint:**\n```bash\naws ec2 create-vpc-endpoint \\\n  --vpc-id \u003Cvpc-id> \\\n  --service-name com.amazonaws.us-east-1.dynamodb \\\n  --vpc-endpoint-type Gateway \\\n  --route-table-ids \u003Crtb-id-1> \u003Crtb-id-2> \\\n  --output json\n```\n\n**Savings estimate:**\n```\nS3 savings   = S3_GB_through_NAT × $0.045\nDynamoDB savings = DDB_GB_through_NAT × $0.045\n```\n\nThese savings are captured in FULL — Gateway endpoints are free, so every\ndollar of redirected traffic is a dollar saved. There is no break-even\nthreshold.\n\nIf S3 or DynamoDB traffic exists and the Gateway endpoint is absent:\n**OPPORTUNITY_FOUND** on this dimension. This is the single highest-leverage\nrecommendation the skill can make.\n\n### Step 2: Interface endpoints for high-traffic AWS services (break-even analysis)\n\nFor each AWS service with significant traffic through NAT (ECR, SSM, STS,\nSecrets Manager, CloudWatch, KMS, CodeArtifact, etc.), compute the break-even:\n\n```\nMonthly savings = (service_GB × $0.045) − (service_GB × $0.01 + $7.30 × num_AZs)\n```\n\n**Decision matrix:**\n\n| Monthly traffic to service | Verdict | Recommendation |\n|---|---|---|\n| > 200 GB\u002Fmonth (> break-even) | **OPPORTUNITY_FOUND** | Create Interface endpoint in the AZs that originate the traffic |\n| 100-200 GB\u002Fmonth (near break-even) | **OPPORTUNITY_FOUND** (MEDIUM confidence) | Create Interface endpoint in 1-2 AZs; monitor for 30 days |\n| \u003C 100 GB\u002Fmonth (\u003C break-even) | Skip (ALREADY_OPTIMAL for this service) | Do NOT create — endpoint would increase cost |\n\n**Pattern — ECR Interface Endpoint (most common high-traffic candidate):**\n```bash\naws ec2 create-vpc-endpoint \\\n  --vpc-id \u003Cvpc-id> \\\n  --vpc-endpoint-type Interface \\\n  --service-name com.amazonaws.us-east-1.ecr.api \\\n  --subnet-ids \u003Csubnet-1a> \u003Csubnet-1b> \\\n  --security-group-ids \u003Csg-id> \\\n  --private-dns-enabled \\\n  --output json\n\n# Also create the ecr.dkr endpoint for Docker pull\u002Fpush (separate service name)\naws ec2 create-vpc-endpoint \\\n  --vpc-id \u003Cvpc-id> \\\n  --vpc-endpoint-type Interface \\\n  --service-name com.amazonaws.us-east-1.ecr.dkr \\\n  --subnet-ids \u003Csubnet-1a> \u003Csubnet-1b> \\\n  --security-group-ids \u003Csg-id> \\\n  --private-dns-enabled \\\n  --output json\n```\n\n**Common Interface endpoint candidates and their typical break-even:**\n\n| Service | Service name suffix | Typical traffic pattern | Break-even GB\u002Fmonth (per AZ) |\n|---|---|---|---|\n| ECR (api + dkr) | ecr.api, ecr.dkr | Container image pulls\u002Fpushes | ~160 GB (note: TWO endpoints needed) |\n| SSM | ssm | Systems Manager agent check-ins | Low (usually skip) |\n| STS | sts | AssumeRole calls | Very low (skip) |\n| Secrets Manager | secretsmanager | App secret fetches | Low unless high-frequency rotation |\n| CloudWatch Logs | logs | Application log shipping | High if logs are verbose; evaluate |\n| KMS | kms | Encrypt\u002Fdecrypt API calls | Low (skip) |\n| CodeArtifact | codeartifact.api | Package pulls | Medium; evaluate by CI volume |\n\n### Step 3: NAT topology optimisation (single vs multi-AZ)\n\nThe topology decision depends on the environment AND the cross-AZ traffic\nvolume.\n\n**Decision matrix:**\n\n| Environment | Cross-AZ traffic volume | Recommendation |\n|---|---|---|\n| Production, high throughput (> 500 GB\u002Fmonth cross-AZ) | High | Keep one NAT Gateway per AZ — cross-AZ transfer would exceed the base-cost saving |\n| Production, low throughput (\u003C 100 GB\u002Fmonth cross-AZ) | Low | Consolidate to a single NAT Gateway — base-cost saving exceeds cross-AZ transfer |\n| Non-production (dev\u002Ftest\u002Fstaging) | Any | Single NAT Gateway — accept cross-AZ cost; HA is not required |\n| Non-production, minimal outbound (\u003C 10 GB\u002Fmonth) | Very low | Consider NAT Instance (Step 4) instead |\n\n**Cross-AZ cost calculation for single-NAT topology:**\n```\nCross-AZ cost = total_GB_from_other_AZs × $0.02  (both directions)\nBase saving = (eliminated_gateways × $32.85)\nNet = base_saving − cross_AZ_cost\n```\n\nIf `Net > 0`, single-NAT is cheaper. If `Net \u003C 0`, keep multi-NAT.\n\n**Pattern — consolidate to single NAT Gateway (non-prod):**\n1. Update route tables in all private subnets to point `0.0.0.0\u002F0` to the\n   single remaining NAT Gateway.\n2. Delete the redundant NAT Gateways:\n   `aws ec2 delete-nat-gateway --nat-gateway-id \u003Cid>`.\n3. Release the Elastic IPs:\n   `aws ec2 release-address --allocation-id \u003Ceip-alloc-id>`.\n\n### Step 4: NAT Instance substitution (dev\u002Ftest only)\n\nFor dev\u002Ftest environments with minimal outbound traffic and no HA requirement:\n\n**Pattern — NAT Instance (t3.micro, dev\u002Ftest):**\n```bash\n# Launch a NAT Instance from the public AMI (search for the latest amzn-ami-vpc-nat AMI)\naws ec2 run-instances \\\n  --image-id resolve:ssm:\u002Faws\u002Fservice\u002Fami-amazon-linux-latest\u002Famzn-ami-vpc-nat-hvm \\\n  --instance-type t3.micro \\\n  --subnet-id \u003Cpublic-subnet> \\\n  --associate-public-ip-address \\\n  --tag-specifications \"ResourceType=instance,Tags=[{Key=Name,Value=nat-instance-dev}]\" \\\n  --output json\n\n# Disable source\u002Fdestination checks (required for NAT function)\naws ec2 modify-instance-attribute --instance-id \u003Cid> --no-source-dest-check\n\n# Update route tables to point to the instance instead of the NAT Gateway\naws ec2 replace-route --route-table-id \u003Crtb-id> \\\n  --destination-cidr-block 0.0.0.0\u002F0 --instance-id \u003Cid>\n```\n\n**Savings estimate:**\n```\nNAT Gateway cost = $32.85 (base) + (GB × $0.045)\nNAT Instance cost = $8.47 (t3.micro, flat) + (GB × $0)  [no per-GB charge]\nSaving = NAT_Gateway_cost − $8.47\n```\n\n**Reliability warning (MUST surface in output):**\n- NAT Instance is a single point of failure — no SLA, no automatic failover.\n- Bandwidth is capped by instance type (~1 Gbps for t3.micro).\n- If the underlying host fails, outbound traffic stops until the instance is\n  replaced (manual or via Auto Scaling recovery, which adds 2-5 minutes of\n  downtime).\n- NOT suitable for production workloads.\n\n### Step 5: Aggregation — emit the highest-leverage recommendation\n\nAggregate ALL applicable dimensions into a single recommendation. The verdict\nis `OPPORTUNITY_FOUND` if any dimension has a saving. The recommendation\nincludes the full endpoint-creation and topology-change plan.\n\nIf no dimension has an opportunity (all applicable Gateway endpoints exist,\nInterface endpoints are above break-even where justified, topology matches\nenvironment): **ALREADY_OPTIMAL**.\n\nIf the recommendation was applied this session and verified: **OPTIMIZED**.\n\n## Output format (per VPC)\n\n```text\nVPC: \u003Cvpc-id>\nVERDICT: OPTIMIZED | OPPORTUNITY_FOUND | ALREADY_OPTIMAL\nREASON: \u003C1-2 sentences citing the highest-leverage dimension and step number>\nRECOMMENDATION:\n  \u003Clist of endpoint-creation and topology-change actions>\nSAVINGS:\n  CURRENT_MONTHLY: $\u003CX.XX>\n  PROJECTED_MONTHLY: $\u003CY.YY>\n  MONTHLY_SAVING: $\u003CX.XX - Y.YY>\n  ANNUAL_SAVING: $\u003C12 × monthly>\n  CAVEATS: \u003CInterface endpoint break-even assumptions, NAT Instance reliability warnings>\nIMPLEMENTATION:\n  1. \u003Ccreate-vpc-endpoint CLI command>\n  2. \u003Cdelete-nat-gateway CLI command>\n  3. \u003Cverification command>\n```\n\n### Worked examples (see references\u002Fworked-examples.md)\n\n> Secondary worked examples moved to [references\u002Fworked-examples.md](references\u002Fworked-examples.md) — three full end-to-end scenarios.\n> Load on demand; the primary example under the STRICT output contract below stays in this file.\n\n## STRICT output contract\n\nThe rules below are hard constraints. Violating any one produces an\narithmetic contradiction or a misclassification that breaks downstream\nFinOps automation. Self-check EVERY emitted block against these rules\nbefore returning the response.\n\n### Required output structure\n\nEvery response MUST be a single block per VPC using these literal\nlabels, in this order. Do NOT substitute markdown headings, camelCase,\nor bold variants.\n\n```text\nVPC: \u003Cvpc-id>\nVERDICT: OPTIMIZED | OPPORTUNITY_FOUND | ALREADY_OPTIMAL\nREASON: \u003C1-2 sentences citing the highest-leverage dimension and step number>\nRECOMMENDATION:\n  \u003Clist of endpoint-creation and topology-change actions>\nSAVINGS:\n  CURRENT_MONTHLY: $\u003Camount>    ← MUST show base + data-processing subtotals\n  PROJECTED_MONTHLY: $\u003Camount>\n  MONTHLY_SAVING: $\u003Camount>     ← MUST equal CURRENT − PROJECTED, 2 decimals\n  ANNUAL_SAVING: $\u003Camount>      ← MUST equal MONTHLY × 12\n  CAVEATS: \u003Cbreak-even assumptions, reliability warnings>\nIMPLEMENTATION:\n  1. \u003Ccreate-vpc-endpoint \u002F delete-nat-gateway \u002F replace-route CLI command>\n  2. \u003Cverification command>\n```\n\n### FORBIDDEN output patterns\n\n1. **NEVER emit `VERDICT: OPPORTUNITY_FOUND` with\n   `MONTHLY_SAVING: $0.00`.** If every dimension nets zero saving, the\n   verdict MUST be `ALREADY_OPTIMAL`. An `OPPORTUNITY_FOUND` block with\n   a zero savings line is a direct contradiction.\n\n2. **NEVER show a savings figure where `CURRENT_MONTHLY −\n   PROJECTED_MONTHLY` does not equal `MONTHLY_SAVING`.** Round both\n   sides to 2 decimal places. If they differ, fix the arithmetic before\n   emitting — do NOT append an \"Adjusted to Cost Explorer baseline\" or\n   \"rounding\" reconciliation that masks the mismatch.\n\n3. **NEVER recommend an Interface endpoint without citing the GB\u002Fmonth\n   traffic volume AND the break-even threshold (~160 GB\u002Fmonth per AZ).**\n   The RECOMMENDATION line MUST state: `\u003Cservice>: \u003CX> GB\u002Fmonth vs\n   \u003Cbreak-even> GB\u002Fmonth break-even for \u003CN>-AZ`. An Interface endpoint\n   on traffic below break-even INCREASES cost — that is a negative\n   saving and MUST NOT appear as `OPPORTUNITY_FOUND`.\n\n4. **NEVER include Gateway endpoint (S3, DynamoDB) costs on the cost\n   side of the SAVINGS equation.** Gateway endpoints are free — $0\n   hourly, $0 per-GB. Their absence from a VPC with S3\u002FDynamoDB NAT\n   traffic is always `OPPORTUNITY_FOUND` with the full redirected-GB\n   dollar amount captured as saving.\n\n5. **NEVER recommend a NAT Instance without the reliability warning in\n   CAVEATS.** The warning MUST include: \"single point of failure, no\n   SLA, not suitable for production.\" A NAT Instance recommendation\n   without this caveat is non-compliant.\n\n6. **NEVER emit a \"NOTE: discrepancy due to partial-month data\" or\n   \"Adjusted to Cost Explorer baseline ratio\" line that reconciles\n   arithmetic errors.** If Cost Explorer shows a different figure than\n   the computed subtotal, use the Cost Explorer figure as\n   `CURRENT_MONTHLY` and recompute `PROJECTED_MONTHLY` from it\n   proportionally. The two MUST reconcile without a narrative patch.\n\n7. **NEVER recommend deleting a NAT Gateway without pairing the\n   deletion with `aws ec2 release-address` for the associated EIP.**\n   An unreleased EIP incurs $3.65\u002Fmonth indefinitely — the\n   IMPLEMENTATION block MUST include the release-address step.\n\n8. **NEVER aggregate traffic across services to hit a single Interface\n   endpoint break-even.** Each Interface endpoint is a separate\n   financial decision with its own break-even. S3 (100 GB) + ECR (60\n   GB) does NOT justify an ECR endpoint at 160 GB.\n\n### Perfect example output — OPPORTUNITY_FOUND with verified math\n\nEvery field below is internally consistent. Copy this shape exactly.\n\n```text\nVPC: vpc-0abc123\nVERDICT: OPPORTUNITY_FOUND\nREASON: 3-AZ production VPC with 3 NAT Gateways processing 2,400 GB\u002Fmonth.\n  No Gateway endpoints exist — 900 GB\u002Fmonth S3 + 200 GB\u002Fmonth DynamoDB\n  flow through NAT (Step 1). ECR at 150 GB\u002Fmonth is below 160 GB\u002FAZ\n  break-even (Step 2, skipped). Topology correct for production (Step 3).\nRECOMMENDATION:\n  1. Create S3 Gateway Endpoint (FREE) — reroutes 900 GB\u002Fmonth off NAT.\n  2. Create DynamoDB Gateway Endpoint (FREE) — reroutes 200 GB\u002Fmonth.\n  3. Skip ECR Interface Endpoint: 150 GB \u003C 160 GB break-even for 1-AZ.\n  4. Topology: keep 3 NAT Gateways (production, high throughput).\nSAVINGS:\n  CURRENT_MONTHLY: $206.55\n    NAT base: 3 × $32.85 = $98.55\n    NAT data processing: 2,400 GB × $0.045 = $108.00\n  PROJECTED_MONTHLY: $157.05\n    NAT base: 3 × $32.85 = $98.55 (unchanged)\n    NAT data processing: 1,300 GB × $0.045 = $58.50\n    Gateway endpoints: $0.00 (free)\n  MONTHLY_SAVING: $49.50\n    ($206.55 − $157.05 = $49.50 ✓)\n    (1,100 GB × $0.045 = $49.50 ✓)\n  ANNUAL_SAVING: $594.00\n  CAVEATS:\n    - Gateway endpoints are free — savings captured in full.\n    - ECR Interface endpoint NOT recommended: below break-even.\n    - Cross-region S3 access not covered by regional Gateway endpoint.\nIMPLEMENTATION:\n  1. CONFIRM: Create S3 + DynamoDB Gateway endpoints on vpc-0abc123. Proceed?\n  2. aws ec2 create-vpc-endpoint --vpc-id vpc-0abc123 --service-name com.amazonaws.us-east-1.s3 --vpc-endpoint-type Gateway --route-table-ids rtb-aaa rtb-bbb rtb-ccc\n  3. aws ec2 create-vpc-endpoint --vpc-id vpc-0abc123 --service-name com.amazonaws.us-east-1.dynamodb --vpc-endpoint-type Gateway --route-table-ids rtb-aaa rtb-bbb rtb-ccc\n  4. Verify: aws ec2 describe-vpc-endpoints --filter \"Name=vpc-id,Values=vpc-0abc123\"\n  5. After 24h, re-query Cost Explorer — expect ~$49.50\u002Fmo reduction.\n```\n\n**Self-check before emit:**\n- [ ] `CURRENT_MONTHLY − PROJECTED_MONTHLY == MONTHLY_SAVING` (2 decimals)?\n- [ ] `MONTHLY_SAVING × 12 == ANNUAL_SAVING`?\n- [ ] Every Interface endpoint recommendation cites GB\u002Fmonth vs break-even?\n- [ ] NAT Instance recommendation includes reliability warning?\n- [ ] NAT Gateway deletion paired with `release-address`?\n- [ ] No \"adjusted\" or \"discrepancy\" reconciliation lines?\n\n## Verdict consistency rules (prevent misclassification)\n\nThe skill MUST emit verdicts that are mathematically and logically\nself-consistent:\n\n1. **Zero-savings rule.** If `MONTHLY_SAVING == $0.00` for every dimension,\n   the verdict MUST be `ALREADY_OPTIMAL`, never `OPPORTUNITY_FOUND`.\n\n2. **Negative-savings rule.** If an Interface endpoint would cost MORE than\n   the NAT processing it replaces (traffic below break-even), do NOT recommend\n   it. The verdict for that dimension is \"no action.\" Emitting\n   `OPPORTUNITY_FOUND` with a negative saving is a hard error.\n\n3. **OPPORTUNITY_FOUND requires a non-zero savings line.** When emitting\n   `OPPORTUNITY_FOUND`, the SAVINGS block must show a positive `MONTHLY_SAVING`\n   for at least one dimension.\n\n4. **SAVINGS arithmetic check.** `CURRENT_MONTHLY − PROJECTED_MONTHLY` MUST\n   equal `MONTHLY_SAVING`. Round to 2 decimal places.\n\n5. **Gateway endpoint is always free.** Never include a Gateway endpoint\n   (S3, DynamoDB) in the cost side of the equation. Its absence from a VPC\n   with S3\u002FDynamoDB traffic is always OPPORTUNITY_FOUND.\n\n6. **NAT Instance recommendations MUST include the reliability warning.**\n   A NAT Instance recommendation without the \"single point of failure,\n   not suitable for production\" caveat is non-compliant.\n\n7. **Elastic IP release must accompany NAT Gateway deletion.** A NAT Gateway\n   deletion without `release-address` for the associated EIP leaves a\n   $3.65\u002Fmonth orphan charge.\n\n## Error handling and edge cases (see references\u002Ftroubleshooting.md)\n\n> Error-handling deep dives, API error tables, and edge-case topologies moved to [references\u002Ftroubleshooting.md](references\u002Ftroubleshooting.md).\n> Load on demand when a CLI\u002Fdata-source call fails or the topology is unusual.\n\n## Anti-Patterns — NEVER (top 5)\n\n1. **NEVER recommend an Interface endpoint without quantifying monthly\n   traffic volume.** An Interface endpoint on a low-traffic VPC INCREASES\n   cost by $7.30\u002FAZ\u002Fmonth. Always cite GB\u002Fmonth and confirm it exceeds\n   break-even (~160 GB\u002Fmonth per AZ).\n\n2. **NEVER recommend a NAT Instance for production.** NAT Instance is a\n   single point of failure with no SLA and bandwidth caps. Dev\u002Ftest only.\n   A cost saving that causes a production outage is a net loss.\n\n3. **NEVER delete a NAT Gateway without updating route tables FIRST and\n   pairing deletion with `release-address` for the EIP.** A route still\n   pointing to a deleted gateway black-holes the subnet; an unreleased\n   EIP leaks $3.65\u002Fmonth indefinitely.\n\n4. **NEVER recommend single-NAT topology for production with high\n   cross-AZ traffic without computing cross-AZ transfer cost.** The\n   cross-AZ charge ($0.01\u002FGB each direction) can exceed the base-cost\n   saving of eliminating gateways.\n\n5. **NEVER auto-apply endpoint or topology changes without the CONFIRM\n   gate, and NEVER batch VPC changes.** A wrong route-table update can\n   black-hole an entire VPC's outbound traffic; process one VPC per\n   CONFIRM gate so errors do not cascade.\n\nAdditional NEVER rules (aggregate break-even, cross-region Gateway\ncoverage, S3 Interface vs Gateway, Flow Logs filtering, NAT Instance\nsource\u002Fdest-check) appear in `references\u002Fexpert-knowledge.md` and the\nFORBIDDEN output patterns section above.\n\n## Pre-flight safety checks (run before any remediation CLI)\n\n> Pre-flight safety check listing (CONFIRM gate, route-table backup, state verification, policy review) moved to [references\u002Fdiagnostic-commands.md](references\u002Fdiagnostic-commands.md).\n> Run before any remediation CLI.\n\n## Recent AWS features (2024-2026)\n\n> Recent AWS features (2024-2026) moved to [references\u002Fadvanced-patterns.md](references\u002Fadvanced-patterns.md).\n> Load on demand for newer capabilities that affect endpoint topology and sizing choices.\n\n## Domain\n\nAWS CloudOps \u002F Networking Cost Optimisation & VPC Endpoint Design.\n\n## AWS documentation\n\n- **Amazon VPC User Guide — VPC Endpoints** — https:\u002F\u002Fdocs.aws.amazon.com\u002Fvpc\u002Flatest\u002Fprivatelink\u002Fconcepts.html\n- **AWS PrivateLink** — https:\u002F\u002Faws.amazon.com\u002Fprivatelink\u002F\n- **NAT Gateways** — https:\u002F\u002Fdocs.aws.amazon.com\u002Fvpc\u002Flatest\u002Fuserguide\u002Fvpc-nat-gateway.html\n- **Gateway VPC Endpoints (S3, DynamoDB)** — https:\u002F\u002Fdocs.aws.amazon.com\u002Fvpc\u002Flatest\u002Fprivatelink\u002Fgateway-endpoints.html\n- **Interface VPC Endpoints (PrivateLink)** — https:\u002F\u002Fdocs.aws.amazon.com\u002Fvpc\u002Flatest\u002Fprivatelink\u002Finterface-endpoints.html\n- **VPC Pricing — NAT Gateway** — https:\u002F\u002Faws.amazon.com\u002Fvpc\u002Fpricing\u002F\n- **AWS CLI Command Reference: ec2** — https:\u002F\u002Fdocs.aws.amazon.com\u002Fcli\u002Flatest\u002Freference\u002Fec2\u002F\n- **VPC Flow Logs** — https:\u002F\u002Fdocs.aws.amazon.com\u002Fvpc\u002Flatest\u002Fuserguide\u002Fflow-logs.html\n- **AWS Well-Architected Framework — Cost Optimization** — https:\u002F\u002Fdocs.aws.amazon.com\u002Fwellarchitected\u002Flatest\u002Fcost-optimization-pillar\u002Fwelcome.html\n## References (load on demand)\n\n- [references\u002Fdiagnostic-commands.md](references\u002Fdiagnostic-commands.md) — pre-flight VPC metadata gate commands and pre-flight safety checks.\n- [references\u002Fadvanced-patterns.md](references\u002Fadvanced-patterns.md) — recent AWS features (2024-2026).\n- [references\u002Fexpert-knowledge.md](references\u002Fexpert-knowledge.md) — Step-0 non-obvious behaviours and the four networking realities.\n- [references\u002Ftroubleshooting.md](references\u002Ftroubleshooting.md) — error handling, API error tables, edge cases.\n- [references\u002Fworked-examples.md](references\u002Fworked-examples.md) — three full end-to-end worked examples.\n- [references\u002Fvpc-endpoint-pricing-matrix.md](references\u002Fvpc-endpoint-pricing-matrix.md) — detailed pricing matrix and cost baseline.\n\n",{"name":5,"license":15,"metadata":24,"description":7,"compatibility":44},{"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,"when_not_to_use":39,"lifecycle_status":40,"invocation_schema":41,"supports_pipeline":37,"invocation_example":42,"activation_triggers":43},"nat-gateway, vpc, networking, cost-optimization, finops, vpc-endpoint, privatelink","3","Jacky Chan — AWS Community Builder","aws-cloudops","FinOps","0.1.0","NAT Gateway, VPC Endpoint, Gateway Endpoint, Interface Endpoint, PrivateLink, S3 Gateway Endpoint, DynamoDB Gateway Endpoint, ECR endpoint, SSM endpoint, STS endpoint, Secrets Manager endpoint, data processing charge, cost optimization, FinOps, NAT Instance, cross-AZ data transfer, VPC Flow Logs, Cost Explorer, AWS PrivateLink","optimize","medium","false","capability","Reviewing NAT Gateway spend, triaging unexpected AWS data-processing charges, designing a VPC endpoint rollout, deciding between single vs multi-AZ NAT topology, evaluating NAT Instance for dev\u002Ftest, or building a networking FinOps plan.","true","OPTIMIZED | OPPORTUNITY_FOUND | ALREADY_OPTIMAL","Auditing Transit Gateway routing (use the networking auditor), VPC peering topology design (architectural, not cost-driven), Direct Connect procurement, or Security Group rule review. This skill focuses on NAT Gateway cost reduction via VPC endpoints and topology choice, not on connectivity troubleshooting or route-table correctness audits.","active","Input: either (a) a VPC configuration (NAT Gateways, route tables, VPC endpoints, subnet-to-AZ mapping, monthly data-processing GB from Cost Explorer), OR (b) a VPC ID for live-account optimisation. Output: a deterministic VPC\u002FVERDICT\u002FREASON\u002FRECOMMENDATION\u002FSAVINGS\u002FIMPLEMENTATION block per VPC, where VERDICT is one of OPTIMIZED, OPPORTUNITY_FOUND, ALREADY_OPTIMAL.","# Minimal valid input (offline classification):\nVPC: vpc-0abc123\nRegion: us-east-1\nEnvironment: production\nNAT Gateways: 3 (one per AZ — us-east-1a, 1b, 1c)\nData processing (last 30 days, Cost Explorer): 2,400 GB total\nCurrent VPC Endpoints: none\nTraffic breakdown (VPC Flow Logs, last 7 days):\n  - S3: 900 GB\u002Fmonth\n  - DynamoDB: 200 GB\u002Fmonth\n  - ECR: 150 GB\u002Fmonth\n  - Other AWS services: 150 GB\u002Fmonth\n  - Internet (non-AWS): 1,000 GB\u002Fmonth\nEmit the standard optimization block (VPC, VERDICT, REASON,\nRECOMMENDATION, SAVINGS, IMPLEMENTATION).","optimise NAT Gateway cost, NAT Gateway data processing charge, VPC endpoint cost benefit, S3 traffic through NAT, create Gateway VPC Endpoint, single NAT Gateway vs multi-AZ, NAT Instance alternative, reduce NAT Gateway bill, VPC Flow Logs traffic breakdown, FinOps networking review, PrivateLink endpoint savings, ECR traffic through NAT, DynamoDB VPC endpoint, unexpected AWS data transfer charge","Agent runtime that reads SKILL.md (Claude Code, Cursor, Windsurf, Codex, Gemini). Offline configuration classification works from pasted VPC topology, Cost Explorer data, and VPC Flow Logs summaries. Live-account optimisation uses aws ec2 describe-nat-gateways, aws ec2 describe-vpc-endpoints, aws ce get-cost-and-usage with filter for NatGateway usage type, aws ec2 describe-route-tables, and aws logs start-query for VPC Flow Logs traffic breakdown (AWS CLI v2, SSO or key-based credentials)...","main","eeace51bd5dd1db2030729d83eeab988861553aa","skills\u002Fnat-gateway-cost-optimizer",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":54,"prompt":64,"zipAvailable":65},[55,58,61],{"tool":56,"command":57},"npx","npx skills add jhkchan\u002Faws-agent-skills --skill nat-gateway-cost-optimizer",{"tool":59,"command":60},"bunx","bunx skills add jhkchan\u002Faws-agent-skills --skill nat-gateway-cost-optimizer",{"tool":62,"command":63},"pnpm","pnpm dlx skills add jhkchan\u002Faws-agent-skills --skill nat-gateway-cost-optimizer","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fjhkchan\u002Faws-agent-skills\u002Fblob\u002Fmain\u002Fskills\u002Fnat-gateway-cost-optimizer\u002FSKILL.md",true,[67,73,77,81,85,89,93,97,101,105,109,113,117,121,125,129,133,137,141,145,149],{"path":68,"resourceType":69,"resourceTypeDesc":70,"sizeBytes":71,"sourceHtmlUrl":72},"eval\u002Ftest-cases.yaml","REFERENCE","参考文档",9355,"https:\u002F\u002Fgithub.com\u002Fjhkchan\u002Faws-agent-skills\u002Fblob\u002Fmain\u002Fskills\u002Fnat-gateway-cost-optimizer\u002Feval\u002Ftest-cases.yaml",{"path":74,"resourceType":69,"resourceTypeDesc":70,"sizeBytes":75,"sourceHtmlUrl":76},"evals\u002Fbaselines\u002Falready-optimal-prod-endpoints.md",672,"https:\u002F\u002Fgithub.com\u002Fjhkchan\u002Faws-agent-skills\u002Fblob\u002Fmain\u002Fskills\u002Fnat-gateway-cost-optimizer\u002Fevals\u002Fbaselines\u002Falready-optimal-prod-endpoints.md",{"path":78,"resourceType":69,"resourceTypeDesc":70,"sizeBytes":79,"sourceHtmlUrl":80},"evals\u002Fbaselines\u002Finterface-endpoint-below-breakeven.md",604,"https:\u002F\u002Fgithub.com\u002Fjhkchan\u002Faws-agent-skills\u002Fblob\u002Fmain\u002Fskills\u002Fnat-gateway-cost-optimizer\u002Fevals\u002Fbaselines\u002Finterface-endpoint-below-breakeven.md",{"path":82,"resourceType":69,"resourceTypeDesc":70,"sizeBytes":83,"sourceHtmlUrl":84},"evals\u002Fbaselines\u002Fmissing-s3-gateway-endpoint.md",730,"https:\u002F\u002Fgithub.com\u002Fjhkchan\u002Faws-agent-skills\u002Fblob\u002Fmain\u002Fskills\u002Fnat-gateway-cost-optimizer\u002Fevals\u002Fbaselines\u002Fmissing-s3-gateway-endpoint.md",{"path":86,"resourceType":69,"resourceTypeDesc":70,"sizeBytes":87,"sourceHtmlUrl":88},"evals\u002Fbaselines\u002Fnat-instance-devtest-substitution.md",667,"https:\u002F\u002Fgithub.com\u002Fjhkchan\u002Faws-agent-skills\u002Fblob\u002Fmain\u002Fskills\u002Fnat-gateway-cost-optimizer\u002Fevals\u002Fbaselines\u002Fnat-instance-devtest-substitution.md",{"path":90,"resourceType":69,"resourceTypeDesc":70,"sizeBytes":91,"sourceHtmlUrl":92},"evals\u002Fbaselines\u002Fredundant-multi-az-nat-nonprod.md",569,"https:\u002F\u002Fgithub.com\u002Fjhkchan\u002Faws-agent-skills\u002Fblob\u002Fmain\u002Fskills\u002Fnat-gateway-cost-optimizer\u002Fevals\u002Fbaselines\u002Fredundant-multi-az-nat-nonprod.md",{"path":94,"resourceType":69,"resourceTypeDesc":70,"sizeBytes":95,"sourceHtmlUrl":96},"evals\u002Feval_config.yaml",1845,"https:\u002F\u002Fgithub.com\u002Fjhkchan\u002Faws-agent-skills\u002Fblob\u002Fmain\u002Fskills\u002Fnat-gateway-cost-optimizer\u002Fevals\u002Feval_config.yaml",{"path":98,"resourceType":69,"resourceTypeDesc":70,"sizeBytes":99,"sourceHtmlUrl":100},"evals\u002Fevals.json",4598,"https:\u002F\u002Fgithub.com\u002Fjhkchan\u002Faws-agent-skills\u002Fblob\u002Fmain\u002Fskills\u002Fnat-gateway-cost-optimizer\u002Fevals\u002Fevals.json",{"path":102,"resourceType":69,"resourceTypeDesc":70,"sizeBytes":103,"sourceHtmlUrl":104},"evals\u002Fprompts\u002Falready-optimal-prod-endpoints.md",1309,"https:\u002F\u002Fgithub.com\u002Fjhkchan\u002Faws-agent-skills\u002Fblob\u002Fmain\u002Fskills\u002Fnat-gateway-cost-optimizer\u002Fevals\u002Fprompts\u002Falready-optimal-prod-endpoints.md",{"path":106,"resourceType":69,"resourceTypeDesc":70,"sizeBytes":107,"sourceHtmlUrl":108},"evals\u002Fprompts\u002Finterface-endpoint-below-breakeven.md",1094,"https:\u002F\u002Fgithub.com\u002Fjhkchan\u002Faws-agent-skills\u002Fblob\u002Fmain\u002Fskills\u002Fnat-gateway-cost-optimizer\u002Fevals\u002Fprompts\u002Finterface-endpoint-below-breakeven.md",{"path":110,"resourceType":69,"resourceTypeDesc":70,"sizeBytes":111,"sourceHtmlUrl":112},"evals\u002Fprompts\u002Fmissing-s3-gateway-endpoint.md",1108,"https:\u002F\u002Fgithub.com\u002Fjhkchan\u002Faws-agent-skills\u002Fblob\u002Fmain\u002Fskills\u002Fnat-gateway-cost-optimizer\u002Fevals\u002Fprompts\u002Fmissing-s3-gateway-endpoint.md",{"path":114,"resourceType":69,"resourceTypeDesc":70,"sizeBytes":115,"sourceHtmlUrl":116},"evals\u002Fprompts\u002Fnat-instance-devtest-substitution.md",933,"https:\u002F\u002Fgithub.com\u002Fjhkchan\u002Faws-agent-skills\u002Fblob\u002Fmain\u002Fskills\u002Fnat-gateway-cost-optimizer\u002Fevals\u002Fprompts\u002Fnat-instance-devtest-substitution.md",{"path":118,"resourceType":69,"resourceTypeDesc":70,"sizeBytes":119,"sourceHtmlUrl":120},"evals\u002Fprompts\u002Fredundant-multi-az-nat-nonprod.md",854,"https:\u002F\u002Fgithub.com\u002Fjhkchan\u002Faws-agent-skills\u002Fblob\u002Fmain\u002Fskills\u002Fnat-gateway-cost-optimizer\u002Fevals\u002Fprompts\u002Fredundant-multi-az-nat-nonprod.md",{"path":122,"resourceType":69,"resourceTypeDesc":70,"sizeBytes":123,"sourceHtmlUrl":124},"examples\u002FREADME.md",6914,"https:\u002F\u002Fgithub.com\u002Fjhkchan\u002Faws-agent-skills\u002Fblob\u002Fmain\u002Fskills\u002Fnat-gateway-cost-optimizer\u002Fexamples\u002FREADME.md",{"path":126,"resourceType":69,"resourceTypeDesc":70,"sizeBytes":127,"sourceHtmlUrl":128},"references\u002Fadvanced-patterns.md",1281,"https:\u002F\u002Fgithub.com\u002Fjhkchan\u002Faws-agent-skills\u002Fblob\u002Fmain\u002Fskills\u002Fnat-gateway-cost-optimizer\u002Freferences\u002Fadvanced-patterns.md",{"path":130,"resourceType":69,"resourceTypeDesc":70,"sizeBytes":131,"sourceHtmlUrl":132},"references\u002Fdiagnostic-commands.md",4594,"https:\u002F\u002Fgithub.com\u002Fjhkchan\u002Faws-agent-skills\u002Fblob\u002Fmain\u002Fskills\u002Fnat-gateway-cost-optimizer\u002Freferences\u002Fdiagnostic-commands.md",{"path":134,"resourceType":69,"resourceTypeDesc":70,"sizeBytes":135,"sourceHtmlUrl":136},"references\u002Fexpert-knowledge.md",8068,"https:\u002F\u002Fgithub.com\u002Fjhkchan\u002Faws-agent-skills\u002Fblob\u002Fmain\u002Fskills\u002Fnat-gateway-cost-optimizer\u002Freferences\u002Fexpert-knowledge.md",{"path":138,"resourceType":69,"resourceTypeDesc":70,"sizeBytes":139,"sourceHtmlUrl":140},"references\u002Ftroubleshooting.md",7302,"https:\u002F\u002Fgithub.com\u002Fjhkchan\u002Faws-agent-skills\u002Fblob\u002Fmain\u002Fskills\u002Fnat-gateway-cost-optimizer\u002Freferences\u002Ftroubleshooting.md",{"path":142,"resourceType":69,"resourceTypeDesc":70,"sizeBytes":143,"sourceHtmlUrl":144},"references\u002Fvpc-endpoint-pricing-matrix.md",7798,"https:\u002F\u002Fgithub.com\u002Fjhkchan\u002Faws-agent-skills\u002Fblob\u002Fmain\u002Fskills\u002Fnat-gateway-cost-optimizer\u002Freferences\u002Fvpc-endpoint-pricing-matrix.md",{"path":146,"resourceType":69,"resourceTypeDesc":70,"sizeBytes":147,"sourceHtmlUrl":148},"references\u002Fworked-examples.md",6916,"https:\u002F\u002Fgithub.com\u002Fjhkchan\u002Faws-agent-skills\u002Fblob\u002Fmain\u002Fskills\u002Fnat-gateway-cost-optimizer\u002Freferences\u002Fworked-examples.md",{"path":150,"resourceType":69,"resourceTypeDesc":70,"sizeBytes":151,"sourceHtmlUrl":152},"skill.usf.yaml",4540,"https:\u002F\u002Fgithub.com\u002Fjhkchan\u002Faws-agent-skills\u002Fblob\u002Fmain\u002Fskills\u002Fnat-gateway-cost-optimizer\u002Fskill.usf.yaml",[154,161,168,175,182,189],{"skillNo":155,"name":156,"nameZh":6,"description":157,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":158,"categories":159,"keywords":160,"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":162,"name":163,"nameZh":6,"description":164,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":165,"categories":166,"keywords":167,"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":169,"name":170,"nameZh":6,"description":171,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":172,"categories":173,"keywords":174,"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":176,"name":177,"nameZh":6,"description":178,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":179,"categories":180,"keywords":181,"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":183,"name":184,"nameZh":6,"description":185,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":186,"categories":187,"keywords":188,"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":190,"name":191,"nameZh":6,"description":192,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":193,"categories":194,"keywords":195,"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",[],[]]