跳到正文
FunCoding

aws-cost-ops

AWS Cost Explorer — spending analysis, service breakdowns, forecasts, cost anomalies. Use when analyzing AWS spending, investigating cost spikes, reviewing network cost drivers like NAT Gateway, or forecasting next month's bill.

Star
740
许可证
Apache-2.0
最近提交
2026年12月2日

workspace/skills/aws-cost-ops/SKILL.md

在 GitHub 上查看

AWS Cost Operations

MCP Server

  • Command: uvx awslabs.cost-explorer-mcp-server@latest (stdio transport)
  • Requires: AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY, AWS_REGION (or AWS_PROFILE)
  • Note: Cost Explorer API charges $0.01 per request — be mindful of query volume

Key Capabilities

  • Cost breakdown: Spending by service, account, region, or tag
  • Time series: Daily, monthly, or custom date range cost trends
  • Forecasts: Predicted spend based on historical patterns
  • Anomaly detection: Unusual spending spikes
  • Filtering: Narrow by service (EC2, VPC, TGW, NAT GW, VPN, etc.)

Workflow: Network Cost Analysis

When a user asks "how much is our AWS network costing?":

  1. Total network spend: Cost breakdown for VPC, Transit Gateway, NAT Gateway, VPN, ELB, Direct Connect
  2. Trend: Monthly trend for network services over last 6 months
  3. Top services: Rank network services by spend (NAT GW data processing is often #1)
  4. Per-region: Break down network costs by region
  5. Forecast: Projected network spend for next month
  6. Report: Network cost dashboard with optimization recommendations

Workflow: Cost Anomaly Investigation

When investigating unexpected charges:

  1. Daily breakdown: Get daily costs for the spike period
  2. Service drill-down: Which service caused the spike?
  3. Region check: Was the spike in a specific region?
  4. Correlate: Cross-reference with CloudTrail for resource creation events
  5. Report: Root cause and recommended action

Workflow: Monthly Cost Review

For regular FinOps review:

  1. Month-over-month: Compare current vs previous month spending
  2. Service breakdown: Top 10 services by cost
  3. Network focus: VPC, TGW, NAT GW, VPN, ELB, Direct Connect costs
  4. Growth rate: Percentage change per service
  5. Forecast: Next month projection
  6. Report: Executive cost summary with trends

Common AWS Network Cost Drivers

ServiceCost ComponentTypical Driver
NAT GatewayData processing$0.045/GB — largest network cost for most
NAT GatewayHourly charge$0.045/hr per NAT GW
Transit GatewayData processing$0.02/GB per attachment
Transit GatewayHourly charge$0.05/hr per attachment
VPNHourly charge$0.05/hr per VPN connection
VPNData transfer$0.09/GB outbound
ELB (ALB)Hourly + LCU$0.0225/hr + LCU charges
ELB (NLB)Hourly + NLCU$0.0225/hr + NLCU charges
Direct ConnectPort hours$0.03-$0.30/hr depending on speed
Data TransferCross-AZ$0.01/GB each direction
Data TransferCross-Region$0.02/GB
Data TransferInternet out$0.09/GB (first 10TB)

Cost Optimization Tips

FindingRecommendation
High NAT GW data processingUse VPC endpoints for S3/DynamoDB (free)
Multiple NAT GWs per AZConsolidate if traffic allows
Idle VPN connectionsDelete unused VPN tunnels
Cross-AZ trafficCo-locate resources in same AZ where possible
Oversized ELBRight-size based on actual LCU/NLCU usage
Unused EIPsRelease unattached Elastic IPs ($0.005/hr)

Important Rules

  • Cost Explorer API charges $0.01 per request — batch queries, avoid excessive polling
  • Data lag — Cost data can be delayed up to 24 hours
  • Unblended vs amortized — clarify which cost type the user wants
  • Record in GAIT — log cost investigations for audit trail

Environment Variables

  • AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY, AWS_REGION (or AWS_PROFILE)

Failure Behavior

  • On a tool error (timeout, unreachable host, malformed response), report the failure and its error message directly to the user rather than fabricating or guessing at results.
  • For a confirmed read-only call, check connectivity and retry once if appropriate. For any call that changes state or sends a message, a timeout does not prove the action failed: inspect current state or delivery status before retrying, preserve the required approval/change gates, and do not repeat an action whose outcome is unknown.

相似的 Skill

精选

internal-comms

写内部沟通文档,遵循公司格式,包括状态报告、领导更新和公司通讯。

ANanthropics/skills203k近 7 天新增 2,822 个 star

canary

GAgarrytan/gstack143k近 7 天新增 524 个 star

observability-and-instrumentation

ADaddyosmani/agent-skills122k近 7 天新增 1,421 个 star

精选

shipping-and-launch

上线前逐项检查,规划监控、分阶段发布和回滚方案。

ADaddyosmani/agent-skills122k近 7 天新增 1,421 个 star

paperclip-board

PApaperclipai/paperclip119k近 7 天新增 1,727 个 star

ruview-mmwave

RUruvnet/RuView106k近 7 天新增 596 个 star