{"id":50564289,"url":"https://github.com/sirzzang/aws-cost-estimation","last_synced_at":"2026-06-04T13:02:04.568Z","repository":{"id":355754560,"uuid":"1229452898","full_name":"sirzzang/aws-cost-estimation","owner":"sirzzang","description":"Claude Code skill for AWS IaC cost awareness: estimate before apply, audit what's running","archived":false,"fork":false,"pushed_at":"2026-05-05T04:09:06.000Z","size":27,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-05-05T06:20:25.192Z","etag":null,"topics":["aws","aws-cost","claude-code","claude-code-skill","cloudformation","cost-estimation","finops","iac","infracost","terraform"],"latest_commit_sha":null,"homepage":"","language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/sirzzang.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-05-05T04:00:53.000Z","updated_at":"2026-05-05T04:09:10.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/sirzzang/aws-cost-estimation","commit_stats":null,"previous_names":["sirzzang/aws-cost-estimation"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/sirzzang/aws-cost-estimation","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sirzzang%2Faws-cost-estimation","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sirzzang%2Faws-cost-estimation/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sirzzang%2Faws-cost-estimation/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sirzzang%2Faws-cost-estimation/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sirzzang","download_url":"https://codeload.github.com/sirzzang/aws-cost-estimation/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sirzzang%2Faws-cost-estimation/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33905359,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-04T02:00:06.755Z","response_time":64,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["aws","aws-cost","claude-code","claude-code-skill","cloudformation","cost-estimation","finops","iac","infracost","terraform"],"created_at":"2026-06-04T13:02:03.892Z","updated_at":"2026-06-04T13:02:04.562Z","avatar_url":"https://github.com/sirzzang.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# aws-cost — Claude Code skill\n\nAWS IaC(terraform / CloudFormation / shell)로 띄울 환경의 **사전 비용 견적(estimate)** + 현재 계정의 **활성 리소스 사후 감사(audit)** + SessionStart 시 자동 1~2줄 알림(watch).\n\n## Why this exists\n\nIaC로 띄운 AWS 리소스를 destroy하지 못하고 잊어버려 누적 청구가 발생하는 패턴을 차단하기 위한 개인 도구. \"프로비저닝 시점에 시간·일별 단가를 자각하지 못한다\"는 점이 근본 원인이라 보고, 그걸 자동화로 자극하는 작은 스킬을 만들었습니다. 본 repo는 **개인 작업 기록**이며 누군가 널리 쓸 거라 기대하지 않습니다.\n\n## Modes\n\n| 모드 | 호출 | 용도 |\n|------|------|------|\n| `estimate` | `/aws-cost estimate [path]` | IaC 디렉토리 분류 → terraform이면 infracost로 정확 견적, 그 외는 LLM-fallback 절차로 견적 (±30% 오차 disclaimer 의무) |\n| `audit` | `/aws-cost audit` | 현재 인증된 AWS 계정의 활성 리소스 인벤토리 + LaunchTime 기반 누적 추정 비용 + 삭제 권고 명령 예시 |\n| `watch` | SessionStart hook이 자동 호출 | cwd가 IaC 디렉토리면 estimate 권장 1줄, 활성 리소스 캐시가 있으면 audit 1줄. 둘 다 없으면 silent. |\n\n## Disclaimers (꼭 먼저 읽으세요)\n\n1. **공개된 본 repo는 민감 정보 익명화 완료** — 사용자 식별자, AWS 계정 ID, 이메일, 절대경로 등 개인 정보 제거.\n2. **`prices/seoul-cheatsheet.json`은 ap-northeast-2 기준 작성 시점 스냅샷이며 예시일 뿐**입니다. AWS 단가는 자주 변하고, 본 스냅샷은 작성자가 수동으로 채운 DRAFT 상태입니다. 다른 리전, GPU 인스턴스 군, Fargate 단가는 특히 빠르게 변하므로 그대로 신뢰하지 마세요. 정확한 단가가 필요하면 `aws pricing get-products` 또는 [infracost](https://www.infracost.io)를 사용하세요.\n3. **목적은 \"대략 파악\"입니다.** ±15~30% 오차를 가정하고 의사결정 보조 도구로만 쓰세요. 실제 청구액은 AWS Budgets / Cost Explorer 콘솔이 ground truth입니다. 본 도구는 비용 사고를 **막기 위한 인지 자극**이지 회계 도구가 아닙니다.\n\n## Install\n\n```bash\n# 1) ~/.claude/skills 아래로 clone\ngit clone https://github.com/sirzzang/aws-cost-estimation.git ~/.claude/skills/aws-cost\n\n# 2) (선택) IDE 진입 편의용 역방향 symlink\nln -s ~/.claude/skills/aws-cost ~/projects/aws-cost-skill\n\n# 3) (선택) SessionStart + UserPromptSubmit hook 등록\n#    ~/.claude/settings.json의 hooks 키 아래에 다음 두 항목을 추가:\n#    \"SessionStart\":     [{\"matcher\":\"*\",\"hooks\":[{\"type\":\"command\",\"command\":\"~/.claude/skills/aws-cost/watch.sh\"}]}]\n#    \"UserPromptSubmit\": [{\"matcher\":\"*\",\"hooks\":[{\"type\":\"command\",\"command\":\"~/.claude/skills/aws-cost/lib/prompt-hint.sh\"}]}]\n```\n\n### 의존성\n\n| 도구 | 필수 여부 | 용도 |\n|------|-----------|------|\n| `bash` 4+, `jq`, `python3` | 필수 | 모든 스크립트 |\n| `aws` CLI (configured) | audit 모드 | read-only describe/list 호출 |\n| `terraform` | estimate terraform path | `terraform plan -refresh=false -backend=false` |\n| `infracost` | 권장 (없어도 동작) | terraform 정확 견적. 미설치 시 LLM fallback. |\n\n## Examples\n\n### 1) 아무 디렉토리에서 그냥 `/aws-cost`\n\nwatch는 출력이 없고(IaC 신호 없음 + 활성 리소스 캐시 없음), Claude가 모드를 선택하라고 안내합니다.\n\n```\n❯ /aws-cost\n\n⏺ Bash($HOME/.claude/skills/aws-cost/watch.sh)\n  ⎿  (No output)\n\nwatch 모드는 출력이 없네요 — 현재 디렉토리가 IaC 디렉토리가 아니고 활성 리소스 감사\n캐시도 없는 상태입니다.\n\n어떤 모드를 실행할까요?\n  estimate  /aws-cost estimate [경로]   IaC 비용 사전 견적\n  audit     /aws-cost audit             활성 리소스 + 누적 추정 + 삭제 권고\n```\n\n### 2) Terraform 디렉토리에서 `/aws-cost estimate .`\n\nEKS + GPU 노드 그룹이 있는 IaC 디렉토리에서 호출. infracost가 미설치 환경이라 LLM-fallback 절차가 동작 → 디렉토리 IaC 파일을 읽고 `var.tf` default 값으로 idle/실습 두 시나리오를 분리 견적합니다.\n\n```\n⏺ /aws-cost estimate — \u003csome-iac-dir\u003e/ Terraform 견적\n  환율 가정: 1 USD = 1,400 KRW · 리전: ap-northeast-2\n\n  리소스 인벤토리 (var.tf defaults)\n  ┌──────────────────────┬────────────────────────────┬────────────┬────────┐\n  │       구성요소       │           수량              │ 단가 USD/h │  소계  │\n  ├──────────────────────┼────────────────────────────┼────────────┼────────┤\n  │ EKS Control Plane    │ × 1                         │ 0.10       │ 0.1000 │\n  │ System NG (primary)  │ t3.medium × 2               │ 0.0512     │ 0.1024 │\n  │ System NG EBS        │ gp3 30 GiB × 2              │ 0.0912/GB월│ 0.0075 │\n  │ GPU NG (실습 중)      │ g5.xlarge × 2              │ 1.408      │ 2.8160 │\n  │ GPU NG EBS           │ gp3 100 GiB × 2             │ 0.0912/GB월│ 0.0250 │\n  │ NAT Gateway          │ single-NAT × 1              │ 0.059      │ 0.0590 │\n  └──────────────────────┴────────────────────────────┴────────────┴────────┘\n\n  (A) Idle baseline — gpu_desired_size=0\n  ── 시간당   USD $0.27 / KRW 376\n  ── 24h     USD $6.45 / KRW 9,035\n  ── 1주     USD $45.18 / KRW 63,245\n  ── 30일    USD $193.61 / KRW 271,051\n\n  (B) GPU 실습 운용 — desired=2 (g5.xlarge × 2)\n  ── 시간당   USD $3.11 / KRW 4,354\n  ── 24h     USD $74.64 / KRW 104,492\n  ── 1주     USD $522.46 / KRW 731,446\n  ── 30일    USD $2239.12 / KRW 3,134,769\n\n  ⚠️ 본 견적은 LLM 추론 + 단가 합산 결과이며 ±30% 오차 가능. 정확도가 필요하면 infracost 사용 권장.\n```\n\n\u003e 위 단가표는 **예시이며 작성 시점 스냅샷**입니다. 본인 환경 시점의 실제 단가는 `aws pricing get-products` 또는 infracost로 재확인하세요.\n\n### 3) `/aws-cost audit` — 활성 리소스 0건 케이스\n\ndestroy를 잘 마친 직후나 잔존 리소스가 없는 상태에서의 정상 출력. 이 라인이 보이는 게 안전 신호입니다.\n\n```\n❯ /aws-cost audit\n\n⏺ Bash(~/.claude/skills/aws-cost/lib/audit.sh)\n  ⎿  💰 Account 123456789012 — region ap-northeast-2 — as of 2026-05-05T04:05:46Z\n     활성 리소스 0개  /  일일 추정 USD $0.00 / KRW 0  /  누적 추정 USD $0.00 / KRW 0\n     ───────────────────────────\n\n⏺ AWS 비용 감사 결과\n  계정: 123456789012 (ap-northeast-2 / 서울)\n  기준 시각: 2026-05-05T04:05:46Z\n\n  ┌─────────────┬────────────┐\n  │    항목     │     값     │\n  ├─────────────┼────────────┤\n  │ 활성 리소스 │ 0개        │\n  │ 일일 추정   │ $0.00 / ₩0 │\n  │ 누적 추정   │ $0.00 / ₩0 │\n  └─────────────┴────────────┘\n\n  서울 리전에 떠있는 비용 발생 리소스가 없습니다. 정리할 항목 없음. (환율 1,400 KRW/USD 가정)\n\n  ▎ 참고: 이 감사는 ap-northeast-2 단일 리전 기준입니다. 다른 리전(us-east-1 등)에 잔존 리소스가\n  ▎ 있을 수 있다면 해당 리전에서 별도 확인이 필요합니다.\n```\n\n\u003e audit은 단일 리전 기준이라는 점에 주의. 환경변수 `AWS_REGION` 또는 `AWS_DEFAULT_REGION`로 다른 리전을 지정해서 추가 호출할 수 있습니다.\n\n## Required IAM (read-only)\n\n```\nec2:Describe*\neks:List*, eks:Describe*\nrds:Describe*\nelasticloadbalancing:Describe*\nresource-explorer-2:Search       (optional)\nresource-explorer-2:GetIndex     (optional)\npricing:GetProducts\npricing:DescribeServices\nsts:GetCallerIdentity\n```\n\n`ce:*` 권한은 **사용하지 않습니다**. Cost Explorer API는 호출당 $0.01 추가 과금이고, 동일한 가시화는 AWS Budgets로 가능하기 때문에 의도적으로 제외했습니다.\n\n## Limitations\n\n- **Terraform 외(CFN/shell)는 LLM-fallback 절차**로 동작합니다. Claude가 IaC 파일을 읽고 단가를 합산하므로 ±30% 오차 가능. disclaimer가 자동 표기됩니다.\n- `terraform plan`이 외부 backend(S3, Terraform Cloud 등)를 강제 요구하는 환경에서는 `-backend=false`로 init이 실패할 수 있고, 그 경우 LLM-fallback로 자동 전환됩니다.\n- **시간 단가 기반**입니다. Spot, Reserved, Savings Plan, 데이터 전송 비용은 반영되지 않습니다.\n- 환율은 `1400 KRW/USD`로 고정. 환경변수 `KRW_PER_USD=\u003cn\u003e`로 override 가능.\n- 단가표는 `ap-northeast-2` 기준만 들어 있습니다. 다른 리전은 `aws pricing get-products`로 fallback 조회.\n- 본 도구는 실제 청구액을 보여주지 않습니다(`ce:*` 미사용). 실제 청구는 AWS Budgets / Cost Explorer 콘솔에서 확인하세요.\n- watch hook은 항상 `exit 0`이고 3초 hard timeout이 있어 세션 시작을 차단하지 않습니다.\n\n## Files\n\n```\n~/.claude/skills/aws-cost/\n├── SKILL.md                     # frontmatter + 3 모드 + Examples + Required IAM\n├── watch.sh                     # SessionStart hook 진입점\n├── lib/\n│   ├── classify.sh              # IaC 디렉토리 분류\n│   ├── format.sh                # USD/KRW 포매터 + hourly_table\n│   ├── pricing-lookup.sh        # cheatsheet 조회 helper\n│   ├── audit.sh                 # 활성 리소스 인벤토리 + 누적 비용\n│   ├── infracost-wrap.sh        # terraform plan + infracost breakdown\n│   ├── estimate.sh              # 모드 dispatch (terraform / LLM-fallback)\n│   └── prompt-hint.sh           # UserPromptSubmit hook (위험 키워드 reminder)\n├── prices/\n│   └── seoul-cheatsheet.json    # ap-northeast-2 단가 스냅샷 (DRAFT, 예시)\n└── samples/\n    └── fixtures/                # classify regression 픽스처\n```\n\n## License\n\nMIT (홀더: sirzzang). 자세한 내용은 [LICENSE](LICENSE) 참조. 본 코드는 **as-is**로 제공되며 작성자는 본 도구 사용으로 인한 어떠한 비용·손실에 대해서도 책임지지 않습니다.\n\n## 작성 노트\n\n본 스킬은 Claude Code(Opus 4.7) `oh-my-claudecode:plan` + `oh-my-claudecode:ralph` 워크플로우로 PRD-driven 자동 작성된 결과입니다. 단가표는 LLM이 작성한 수동 스냅샷이라 검증되지 않은 값이 포함될 수 있습니다.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsirzzang%2Faws-cost-estimation","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsirzzang%2Faws-cost-estimation","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsirzzang%2Faws-cost-estimation/lists"}