AWS Cost & Operations

作者: zxkane

此技能提供 AWS 成本優化、監控與營運最佳實務,並整合 MCP 伺服器以進行帳務分析、成本估算、可觀測性及安全評估。

npx skills add https://github.com/zxkane/aws-skills --skill aws-cost-operations

AWS Cost & Operations

This skill provides comprehensive guidance for AWS cost optimization, monitoring, observability, and operational excellence with integrated MCP servers.

AWS Documentation Requirement

Always verify AWS facts using MCP tools (mcp__aws-mcp__* or mcp__*awsdocs*__*) before answering. The aws-mcp-setup dependency is auto-loaded — if MCP tools are unavailable, guide the user through that skill's setup flow.

Integrated MCP Servers

This plugin provides 3 MCP servers:

Bundled Servers

1. AWS Pricing MCP Server (pricing)

Purpose: Pre-deployment cost estimation and optimization

  • Estimate costs before deploying resources
  • Compare pricing across regions
  • Calculate Total Cost of Ownership (TCO)
  • Evaluate different service options for cost efficiency

2. AWS Cost Explorer MCP Server (costexp)

Purpose: Detailed cost analysis and reporting

  • Analyze historical spending patterns
  • Identify cost anomalies and trends
  • Forecast future costs
  • Analyze cost by service, region, or tag

3. Amazon CloudWatch MCP Server (cw)

Purpose: Metrics, alarms, and logs analysis

  • Query CloudWatch metrics and logs
  • Create and manage CloudWatch alarms
  • Troubleshoot operational issues
  • Monitor resource utilization

Note: The following servers are available separately via the Full AWS MCP Server (see aws-mcp-setup skill) and are not bundled with this plugin:

  • AWS Billing and Cost Management MCP — Real-time billing details
  • CloudWatch Application Signals MCP — APM and SLOs
  • AWS Managed Prometheus MCP — PromQL queries for containers
  • AWS CloudTrail MCP — API activity audit
  • AWS Well-Architected Security Assessment MCP — Security posture assessment

When to Use This Skill

Use this skill when:

  • Optimizing AWS costs and reducing spending
  • Estimating costs before deployment
  • Monitoring application and infrastructure performance
  • Setting up observability and alerting
  • Analyzing spending patterns and trends
  • Investigating operational issues
  • Auditing AWS activity and changes
  • Assessing security posture
  • Implementing operational excellence

Cost Optimization Best Practices

Pre-Deployment Cost Estimation

Always estimate costs before deploying:

  1. Use AWS Pricing MCP to estimate resource costs
  2. Compare pricing across different regions
  3. Evaluate alternative service options
  4. Calculate expected monthly costs
  5. Plan for scaling and growth

Example workflow:

"Estimate the monthly cost of running a Lambda function with
1 million invocations, 512MB memory, 3-second duration in us-east-1"

Cost Analysis and Optimization

Regular cost reviews:

  1. Use Cost Explorer MCP to analyze spending trends
  2. Identify cost anomalies and unexpected charges
  3. Review costs by service, region, and environment
  4. Compare actual vs. budgeted costs
  5. Generate cost optimization recommendations

Cost optimization strategies:

  • Right-size over-provisioned resources
  • Use appropriate storage classes (S3, EBS)
  • Implement auto-scaling for dynamic workloads
  • Leverage Savings Plans and Reserved Instances
  • Delete unused resources and snapshots
  • Use cost allocation tags effectively

Budget Monitoring

Track spending against budgets:

  1. Use Billing and Cost Management MCP to monitor budgets
  2. Set up budget alerts for threshold breaches
  3. Review budget utilization regularly
  4. Adjust budgets based on trends
  5. Implement cost controls and governance

Monitoring and Observability Best Practices

CloudWatch Metrics and Alarms

Implement comprehensive monitoring:

  1. Use CloudWatch MCP to query metrics and logs
  2. Set up alarms for critical metrics:
    • CPU and memory utilization
    • Error rates and latency
    • Queue depths and processing times
    • API gateway throttling
    • Lambda errors and timeouts
  3. Create CloudWatch dashboards for visualization
  4. Use log insights for troubleshooting

Example alarm scenarios:

  • Lambda error rate > 1%
  • EC2 CPU utilization > 80%
  • API Gateway 4xx/5xx error spike
  • DynamoDB throttled requests
  • ECS task failures

Application Performance Monitoring

Monitor application health:

  1. Use CloudWatch Application Signals MCP for APM
  2. Track service-level objectives (SLOs)
  3. Monitor application dependencies
  4. Identify performance bottlenecks
  5. Set up distributed tracing

Container and Kubernetes Monitoring

For containerized workloads:

  1. Use AWS Managed Prometheus MCP for metrics
  2. Monitor container resource utilization
  3. Track pod and node health
  4. Create PromQL queries for custom metrics
  5. Set up alerts for container anomalies

Audit and Security Best Practices

CloudTrail Activity Analysis

Audit AWS activity:

  1. Use CloudTrail MCP to analyze API activity
  2. Track who made changes to resources
  3. Investigate security incidents
  4. Monitor for suspicious activity patterns
  5. Audit compliance with policies

Common audit scenarios:

  • "Who deleted this S3 bucket?"
  • "Show all IAM role changes in the last 24 hours"
  • "List failed login attempts"
  • "Find all actions by a specific user"
  • "Track modifications to security groups"

Security Assessment

Regular security reviews:

  1. Use Well-Architected Security Assessment MCP
  2. Assess security posture against best practices
  3. Identify security gaps and vulnerabilities
  4. Implement recommended security improvements
  5. Document security compliance

Security assessment areas:

  • Identity and Access Management (IAM)
  • Detective controls and monitoring
  • Infrastructure protection
  • Data protection and encryption
  • Incident response preparedness

Using MCP Servers Effectively

Cost Analysis Workflow

  1. Pre-deployment: Use Pricing MCP to estimate costs
  2. Post-deployment: Use Billing MCP to track actual spending
  3. Analysis: Use Cost Explorer MCP for detailed cost analysis
  4. Optimization: Implement recommendations from Cost Explorer

Monitoring Workflow

  1. Setup: Configure CloudWatch metrics and alarms
  2. Monitor: Use CloudWatch MCP to track key metrics
  3. Analyze: Use Application Signals for APM insights
  4. Troubleshoot: Query CloudWatch Logs for issue resolution

Security Workflow

  1. Audit: Use CloudTrail MCP to review activity
  2. Assess: Use Well-Architected Security Assessment
  3. Remediate: Implement security recommendations
  4. Monitor: Track security events via CloudWatch

MCP Usage Best Practices

  1. Cost Awareness: Check pricing before deploying resources
  2. Proactive Monitoring: Set up alarms for critical metrics
  3. Regular Reviews: Analyze costs and performance weekly
  4. Audit Trails: Review CloudTrail logs for compliance
  5. Security First: Run security assessments regularly
  6. Optimize Continuously: Act on cost and performance recommendations

Operational Excellence Guidelines

Cost Optimization

  • Tag Everything: Use consistent cost allocation tags
  • Review Monthly: Analyze spending trends and anomalies
  • Right-size: Match resources to actual usage
  • Automate: Use auto-scaling and scheduling
  • Monitor Budgets: Set alerts for cost overruns

Monitoring and Alerting

  • Critical Metrics: Alert on business-critical metrics
  • Noise Reduction: Fine-tune thresholds to reduce false positives
  • Actionable Alerts: Ensure alerts have clear remediation steps
  • Dashboard Visibility: Create dashboards for key stakeholders
  • Log Retention: Balance cost and compliance needs

Security and Compliance

  • Least Privilege: Grant minimum required permissions
  • Audit Regularly: Review CloudTrail logs for anomalies
  • Encrypt Data: Use encryption at rest and in transit
  • Assess Continuously: Run security assessments frequently
  • Incident Response: Have procedures for security events

Additional Resources

For detailed operational patterns and best practices, refer to the comprehensive reference:

File: references/operations-patterns.md

This reference includes:

  • Cost optimization strategies
  • Monitoring and alerting patterns
  • Observability best practices
  • Security and compliance guidelines
  • Troubleshooting workflows

CloudWatch Alarms Reference

File: references/cloudwatch-alarms.md

Common alarm configurations for:

  • Lambda functions
  • EC2 instances
  • RDS databases
  • DynamoDB tables
  • API Gateway
  • ECS services
  • Application Load Balancers

相關技能

i4h-workflow-create
nvidia
透過分叉現有環境來建立新的代理環境。用於新環境/任務 scaffolding,而非場景編輯或烘焙。
azure-upgrade
microsoft
評估並自動化 Azure 工作負載在方案、層級和 SKU 之間的升級。處理方案遷移(從 Consumption 到 Flex Consumption)、層級升級,以及跨服務移動(從 App Service 到 Container Apps),在進行任何變更前先進行順序評估。生成升級前準備就緒報告,收集現有應用程式設定與組態,然後使用冪等指令碼執行自動化升級步驟。需要使用者明確確認破壞性動作及目標方案/SKU...
apiawsdevops
exploring-endpoint-execution-logs
posthog
探索並診斷 PostHog 端點的執行日誌 — 錯誤訊息、執行失敗、快取未命中、執行緩慢,或端點執行期間出現意外的行數…
azure-mgmt-botservice-py
microsoft
Azure Bot Service 管理 Python SDK。用於建立、管理和設定 Azure Bot Service 資源。 觸發詞:「azure-mgmt-botservice」、「AzureBotService」、「bot 管理」、「對話式 AI」、「bot 通道」。
development
pricing
coreyhaines31
當使用者需要定價決策、產品組合或變現策略的協助時使用。也適用於使用者提及「定價」、「定價層級」、「免費增值」、「免費試用」、「產品組合」、「漲價」、「價值指標」、「Van Westendorp」、「支付意願」、「變現」、「我該收多少錢」、「我的定價有問題」、「定價頁面」、「年繳 vs 月繳」、「按席位定價」或「我該提供免費方案嗎」等情況。每當有人在思考該如何收費或如何設計收費結構時,即可使用此技能。
marketingresearchecommerce
image-edit
prime-skills
在RunComfy上編輯圖片—此技能為智慧路由器,可將使用者意圖匹配至RunComfy目錄中的正確編輯模型。選擇Nano Banana Edit(批次最多20張,保留身份預設)、OpenAI GPT Image 2 Edit(多語言圖像文字改寫、多參照合成、佈局精準度)、Flux Kontext Pro(單參照高保真局部編輯)或Z-Image Turbo Inpaint(遮罩驅動精確區域編輯)。整合各模型的文件化提示模式,使技能能...
search-strategy
anthropic
查詢分解與多來源搜尋編排。將自然語言問題拆解為針對各來源的目標搜尋,將查詢轉換為…
auditing-warehouse-source-health
posthog
審核 PostHog 專案資料倉儲來源與同步的健康狀態——找出所有損壞或降級的來源連線、同步結構與 Webhook 頻道。