AWS Cost Operations

Cost optimization and operations management with CloudWatch alarms, operations patterns, and cost monitoring strategies.


npx degit LangbaseInc/agent-skills/aws-cost-operations my-aws-cost-ops

Monitor, analyze, and optimize AWS costs while maintaining operational excellence with automated alerts and best practices.


AWS Cost Explorer

  • Visualize spending patterns
  • Identify cost drivers
  • Forecast future costs
  • Track cost trends

AWS Budgets

  • Set spending limits
  • Get budget alerts
  • Track against targets
  • Forecast overruns

Cost Allocation Tags

  • Organize resources
  • Track by team/project
  • Enable cost attribution
  • Improve visibility

Billing Alarms

new cloudwatch.Alarm(this, 'BillingAlarm', { metric: new cloudwatch.Metric({ namespace: 'AWS/Billing', metricName: 'EstimatedCharges', statistic: 'Maximum', }), threshold: 100, evaluationPeriods: 1, });

Service-Specific Alarms

  • EC2 usage
  • Lambda invocations
  • S3 storage
  • DynamoDB consumption
  • Data transfer

Compute

  • Right-size EC2 instances
  • Use Savings Plans
  • Leverage Spot Instances
  • Auto-scaling groups
  • Lambda instead of always-on

Storage

  • S3 lifecycle policies
  • Glacier for archives
  • Delete unused EBS volumes
  • Use EFS Intelligent-Tiering
  • Compress data

Database

  • Right-size RDS instances
  • Use Aurora Serverless
  • DynamoDB on-demand
  • Delete unused databases
  • Enable auto-pause

Networking

  • Use VPC endpoints
  • CloudFront caching
  • Optimize data transfer
  • Delete unused NAT gateways
  • Use S3 Transfer Acceleration wisely

Automated Cleanup

  • Unused resources
  • Old snapshots
  • Detached volumes
  • Idle load balancers
  • Stale AMIs

Resource Scheduling

  • Start/stop dev environments
  • Scale down non-production
  • Weekend shutdowns
  • After-hours reduction

Reserved Capacity

  • Analyze usage patterns
  • Purchase RIs for steady-state
  • Use Savings Plans
  • Evaluate regularly

Create comprehensive dashboards:

  • Total monthly cost
  • Cost by service
  • Cost by team/project
  • Trending costs
  • Budget vs actual
  • Forecast

Tagging Strategy

  • Environment (dev/prod)
  • Team/Department
  • Project/Application
  • Cost Center
  • Owner

Regular Reviews

  • Weekly cost review
  • Monthly optimization
  • Quarterly planning
  • Annual budget setting

Automation

  • Automated cleanup scripts
  • Resource scheduling
  • Alert notifications
  • Cost reports

Enable AWS Cost Anomaly Detection:

  • Machine learning-based
  • Automatic anomaly alerts
  • Root cause analysis
  • Spending patterns

  • AWS Cost Explorer
  • AWS Budgets
  • AWS Cost Anomaly Detection
  • AWS Compute Optimizer
  • AWS Trusted Advisor
  • CloudWatch
  • Cost & Usage Reports

// Budget with alerts new budgets.CfnBudget(this, 'MonthlyBudget', { budget: { budgetName: 'monthly-budget', budgetLimit: { amount: 1000, unit: 'USD' }, timeUnit: 'MONTHLY', budgetType: 'COST', }, notificationsWithSubscribers: [{ notification: { notificationType: 'ACTUAL', comparisonOperator: 'GREATER_THAN', threshold: 80, }, subscribers: [{ subscriptionType: 'EMAIL', address: 'team@example.com', }], }], });

Generate regular reports:

  • Cost by service
  • Cost trends
  • Savings achieved
  • Optimization opportunities
  • Budget adherence