aws-cost-optimize
Makes your agent analyze and optimize AWS resource costs. It identifies savings opportunities and creates tasks for improvements.
What it does
This tool analyzes your Amazon Web Services (AWS) resources to find ways to save money. It suggests changes and creates tasks in a project management system (GitHub) so you can track improvements.
When to use it
- ✓When you want to reduce your monthly AWS bill.
- ✓Before deploying new services on AWS to ensure they are cost-efficient.
- ✓If you suspect you're overspending on AWS and want to understand where.
Example of what to ask your AI
“Analyze my AWS account and tell me how I can save money, creating tasks in my GitHub repository.”
Want more? Open the sections below.
How to use
The easiest way: copy the message below and paste it into Claude, ChatGPT, Cursor or any AI. It reads the skill and follows the instructions.
Skill link
Ready-to-paste message
How it works
It checks which AWS services you are using, compares them against cost-saving best practices, and identifies optimization opportunities. It then automatically creates detailed tasks for you to implement these savings.
Installation
Easiest way: copy the skill link and paste it into Claude, ChatGPT or Cursor asking it to follow the instructions.
In the terminal (Claude Code, Codex, Cursor), in your project folder:
npx skills add github/awesome-copilot --skill aws-cost-optimizeOr download just the file:
curl -L https://raw.githubusercontent.com/github/awesome-copilot/main/skills/aws-cost-optimize/SKILL.md -o SKILL.mdTechnical content (original SKILL.md)
Original text by the author, straight from GitHub.
AWS Cost Optimize
This workflow analyzes Infrastructure-as-Code (IaC) files and AWS resources to generate cost optimization recommendations. It creates individual GitHub issues for each optimization opportunity plus one EPIC issue to coordinate implementation, enabling efficient tracking and execution of cost savings initiatives.
Prerequisites
- AWS CLI configured and authenticated (
aws sts get-caller-identitysucceeds) - GitHub MCP server configured and authenticated
- Target GitHub repository identified
- AWS resources deployed (IaC files optional but helpful)
Workflow Steps
Step 1: Get AWS Cost Optimization Best Practices
Action: Retrieve cost optimization best practices before analysis
Tools: fetch to retrieve AWS documentation
Process:
- Load Best Practices:
- Fetch
https://docs.aws.amazon.com/cost-management/latest/userguide/cost-optimization-best-practices.html - Fetch the AWS Well-Architected Cost Optimization pillar summary
- Use these practices to inform subsequent analysis and recommendations
- Fetch
Step 2: Discover AWS Infrastructure
Action: Dynamically discover and analyze AWS resources and configurations Tools: AWS CLI + Local file system access Process:
Account & Region Discovery:
- Execute
aws sts get-caller-identityto confirm account - Execute
aws configure get regionto determine default region
- Execute
Resource Discovery (per region):
- EC2 instances:
aws ec2 describe-instances --query 'Reservations[].Instances[].[InstanceId,InstanceType,State.Name,Tags]' - RDS instances:
aws rds describe-db-instances --query 'DBInstances[].[DBInstanceIdentifier,DBInstanceClass,Engine,MultiAZ]' - Lambda functions:
aws lambda list-functions --query 'Functions[].[FunctionName,Runtime,MemorySize,Architectures]' - ECS clusters/services:
aws ecs list-clustersthenaws ecs describe-services - S3 buckets:
aws s3api list-buckets --query 'Buckets[].Name' - ElastiCache clusters:
aws elasticache describe-cache-clusters - NAT Gateways:
aws ec2 describe-nat-gateways - Load Balancers:
aws elbv2 describe-load-balancers
- EC2 instances:
IaC Detection:
- Scan for IaC files:
**/*.tf,**/*.yaml(CloudFormation/SAM),**/*.json(CloudFormation),**/cdk.json,lib/**/*.ts(CDK) - Parse resource definitions to understand intended configurations
- Do NOT use application code files — only IaC files as the source of truth
- If no IaC files found: STOP and report to user
- Scan for IaC files:
Step 3: Collect Usage Metrics & Validate Current Costs
Action: Gather utilization data and verify actual resource costs Tools: AWS CLI (CloudWatch, Cost Explorer) Process:
CloudWatch Metrics (last 7 days):
# EC2 CPU utilization aws cloudwatch get-metric-statistics \ --namespace AWS/EC2 --metric-name CPUUtilization \ --dimensions Name=InstanceId,Value=<id> \ --start-time $(date -u -d '7 days ago' +%Y-%m-%dT%H:%M:%SZ) \ --end-time $(date -u +%Y-%m-%dT%H:%M:%SZ) \ --period 3600 --statistics Average # Lambda duration aws cloudwatch get-metric-statistics \ --namespace AWS/Lambda --metric-name Duration \ --dimensions Name=FunctionName,Value=<name> \ --start-time $(date -u -d '7 days ago' +%Y-%m-%dT%H:%M:%SZ) \ --end-time $(date -u +%Y-%m-%dT%H:%M:%SZ) \ --period 86400 --statistics Average,MaximumAWS Cost Explorer:
aws ce get-cost-and-usage \ --time-period Start=$(date -u -d '30 days ago' +%Y-%m-%d),End=$(date -u +%Y-%m-%d) \ --granularity MONTHLY --metrics BlendedCost \ --group-by Type=DIMENSION,Key=SERVICECalculate Baseline Metrics: CPU/Memory averages, Lambda invocation rates, data transfer patterns, and a realistic current monthly total.
Step 4: Generate Cost Optimization Recommendations
Action: Analyze resources to identify optimization opportunities Process:
Apply Optimization Patterns:
Compute:
- EC2: Right-size based on CPU/memory (<20% average → downsize), convert On-Demand to Savings Plans, migrate to Graviton/ARM (up to 40% cheaper)
- Lambda: Reduce memory for idle functions, switch to
arm64(20% cheaper) - ECS/EKS: Use Fargate Spot for dev/batch workloads
Database:
- RDS: Right-size instance class, convert single-AZ for dev, use Aurora Serverless v2 for variable load
- DynamoDB: Switch Provisioned → On-Demand for unpredictable traffic
…
FAQ
Do I need my code files (IaC) to use this tool?
It's not mandatory, but having the code files that describe your AWS infrastructure helps the tool better understand your setup and provide more accurate recommendations.
What are 'IaC files'?
IaC stands for 'Infrastructure as Code'. These are files where you describe your IT infrastructure (like servers, databases) using code, instead of configuring it manually. Examples include Terraform, CloudFormation, or CDK files.
What happens after the tool finds savings opportunities?
It creates tasks (issues) in your GitHub repository. A main task (EPIC) groups all suggestions, and smaller tasks detail each specific cost-saving opportunity.
Details
Original description by the author
Analyze AWS resources used in the app (IaC files and/or resources in a target account/region) and optimize costs - creating GitHub issues for identified optimizations.
repo: github/awesome-copilot
Popularity
- GitHub stars
- 40k
- Ranking position
- #5016
- License
- MIT
- Updated
- 10/15/2026
Comments
- …
More skills from this repository
acquire-codebase-knowledge
Helps your agent understand and document an existing code project. It's useful for onboarding new people or getting an overview of the architecture.
github/awesome-copilot
acreadiness-assess
Enables your agent to assess a project's readiness for AI and generate a report. It's useful for understanding how well a project is prepared to use AI tools.
github/awesome-copilot
acreadiness-generate-instructions
Helps your agent create instructions for AI tools based on an assessment. It's useful for improving how AI interacts with code and closing identified gaps.
github/awesome-copilot
acreadiness-policy
Enables your agent to help define or apply policies for AI project assessment. It's useful for standardizing how projects are evaluated and ensuring compliance.
github/awesome-copilot
Similar skills
bun-runtime
Has your agent use Bun to run, organize, and test code. It helps choose Bun over other tools and migrate existing projects.
affaan-m/ECC
database-migrations
Helps your agent make safe changes to databases. It ensures changes can be undone and minimizes downtime.
affaan-m/ECC
deployment-patterns
Sets up deployment and CI/CD workflows, containerization, and rollback strategies to ensure safe releases.
affaan-m/ECC