{"id":18217316,"url":"https://github.com/danielrolls/aws-spend-summary","last_synced_at":"2026-04-28T00:31:33.682Z","repository":{"id":260792175,"uuid":"879277166","full_name":"danielrolls/aws-spend-summary","owner":"danielrolls","description":"Free AWS cost monitoring for personal accounts. View daily spending from terminal without expensive Cost Explorer API. Perfect for personal accounts. Haskell/Nix","archived":false,"fork":false,"pushed_at":"2025-08-10T19:50:54.000Z","size":99,"stargazers_count":3,"open_issues_count":3,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-08-10T21:22:41.588Z","etag":null,"topics":["aws","aws-billing","aws-cli","aws-cost-explorer","aws-cost-management","aws-home-user","aws-personal-account","command-line-tool","command-line-tools","cost-monitoring","cost-optimisation","cost-optimization","finops","s3-cost-reports"],"latest_commit_sha":null,"homepage":"","language":"Haskell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/danielrolls.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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}},"created_at":"2024-10-27T13:41:56.000Z","updated_at":"2025-08-10T19:50:49.000Z","dependencies_parsed_at":null,"dependency_job_id":"79019c86-e09b-41ca-9bb8-9ea3c8be5602","html_url":"https://github.com/danielrolls/aws-spend-summary","commit_stats":{"total_commits":8,"total_committers":1,"mean_commits":8.0,"dds":0.0,"last_synced_commit":"a19597a23a8194063b40d500fc087cf8b70ed022"},"previous_names":["danielrolls/aws-spend-summary"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/danielrolls/aws-spend-summary","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/danielrolls%2Faws-spend-summary","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/danielrolls%2Faws-spend-summary/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/danielrolls%2Faws-spend-summary/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/danielrolls%2Faws-spend-summary/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/danielrolls","download_url":"https://codeload.github.com/danielrolls/aws-spend-summary/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/danielrolls%2Faws-spend-summary/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32361477,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-27T20:07:02.737Z","status":"ssl_error","status_checked_at":"2026-04-27T20:07:00.910Z","response_time":128,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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-billing","aws-cli","aws-cost-explorer","aws-cost-management","aws-home-user","aws-personal-account","command-line-tool","command-line-tools","cost-monitoring","cost-optimisation","cost-optimization","finops","s3-cost-reports"],"created_at":"2024-11-03T17:04:43.204Z","updated_at":"2026-04-28T00:31:33.670Z","avatar_url":"https://github.com/danielrolls.png","language":"Haskell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# AWS Spend Summary Tool\n\n[![Packaging status](https://repology.org/badge/vertical-allrepos/aws-spend-summary.svg?columns=4\u0026header=AWS%20Spend%20Summary)](https://repology.org/project/aws-spend-summary/versions)\n\nA command-line tool that displays your recent daily AWS cost usage without needing to log into the AWS console. This tool reads from AWS Cost and Usage Reports stored in S3, which is significantly more cost-effective than using the AWS Cost Explorer API.\n\n![Example usage of aws-spend-summary](images/shell-screenshot-redacted.png)\n\n\n## Features\n\n- 📊 View daily AWS spending from the command line\n- 💰 Set spending thresholds to highlight high-cost days\n- 📄 Export data to CSV for further analysis and reporting\n- 🔄 Automatically merges data from multiple S3 report files\n- 🚀 Fast and cost-effective (uses S3-stored reports instead of expensive APIs)\n- 🔐 Secure authentication using AWS credentials\n\n## Prerequisites\n\n- AWS CLI installed and configured\n- An AWS Cost and Usage Report configured in your AWS account\n- Appropriate IAM permissions\n\n## Installation\n\n```bash\n# Install via Nix\nnix-env -iA nixpkgs.aws-spend-summary\n\n# Or run directly without installing\nnix run nixpkgs#aws-spend-summary\n```\n\n## Quick Start\n\n```bash\naws-spend-summary my-cost-reports reports/monthly my-cost-report --threshold 2.00\n```\n\n## Setup Guide\n\n### 1. Create AWS Cost and Usage Report\n\nBefore using this tool, you need to set up a Cost and Usage Report in AWS:\n\n1. **Navigate to AWS Billing Console**\n   - Go to the [AWS Billing and Cost Management Console](https://console.aws.amazon.com/billing/)\n   - Click on \"Cost \u0026 Usage Reports\" in the left sidebar\n\n2. **Create a New Report**\n   - Click \"Create report\"\n   - Enter a report name (e.g., `daily-cost-report`)\n   - Check \"Include resource IDs\" if you want detailed resource information\n   - Select \"Hourly\" or \"Daily\" granularity (Daily recommended for this tool)\n\n3. **Configure S3 Delivery**\n   - Choose an existing S3 bucket or create a new one\n   - Enter an S3 prefix (path) for organizing reports (e.g., `cost-reports/`)\n   - Select \"CSV\" as the format\n   - Choose \"GZIP\" compression\n   - Enable \"Overwrite existing report\" for the most recent data\n\n4. **Finalize Settings**\n   - Review your settings and click \"Next\"\n   - Click \"Review and Complete\"\n\n**Note**: It can take up to 24 hours for your first report to be generated.\n\n### 2. Configure AWS Credentials\n\nSet up your AWS credentials using the AWS CLI:\n\n```bash\n# Configure credentials (AWS CLI should be available through your system package manager)\naws configure\n```\n\nThis creates:\n- `~/.aws/credentials` - Contains your access keys\n- `~/.aws/config` - Contains account configuration\n\n### 3. Set Up IAM Permissions\n\nCreate an IAM policy with the following permissions for secure access:\n\n```json\n{\n    \"Version\": \"2012-10-17\",\n    \"Statement\": [\n        {\n            \"Sid\": \"CostExplorerAccess\",\n            \"Effect\": \"Allow\",\n            \"Action\": [\n                \"ce:GetCostAndUsage\",\n                \"ce:GetPreferences\",\n                \"ce:GetDimensionValues\",\n                \"ce:GetCostCategories\",\n                \"ce:GetUsageForecast\",\n                \"ce:GetCostForecast\",\n                \"ce:GetTags\",\n                \"ce:ListCostCategoryDefinitions\"\n            ],\n            \"Resource\": \"*\"\n        },\n        {\n            \"Sid\": \"S3CostReportAccess\",\n            \"Effect\": \"Allow\",\n            \"Action\": [\n                \"s3:GetObject\",\n                \"s3:ListBucket\"\n            ],\n            \"Resource\": [\n                \"arn:aws:s3:::your-cost-report-bucket\",\n                \"arn:aws:s3:::your-cost-report-bucket/*\"\n            ]\n        }\n    ]\n}\n```\n\n**Important**: Replace `your-cost-report-bucket` with your actual S3 bucket name.\n\n## Usage\n\n### Basic Usage\n\n```bash\naws-spend-summary BUCKET_NAME BUCKET_PATH COST_REPORT_NAME\n```\n\n### With Spending Threshold\n\n```bash\naws-spend-summary my-costs reports/daily cost-analysis --threshold 5.00\n```\n\n### Command Line Options\n\n| Argument/Option | Description | Required |\n|-----------------|-------------|----------|\n| `BUCKET_NAME` | S3 bucket containing cost reports | Yes |\n| `BUCKET_PATH` | S3 path/prefix to the reports | Yes |\n| `COST_REPORT_NAME` | Name of the cost report | Yes |\n| `-d, --days` | Number of days to show (default: 15) | No |\n| `-t, --threshold` | Threshold for red/green coloring (default: 1.0) | No |\n| `--csv-output` | Output file for CSV export | No |\n\n## Examples\n\n### Monitor Daily Spend\n```bash\naws-spend-summary company-billing cost-reports daily-usage --threshold 10.00\n```\n\n### Check Last 7 Days Only\n```bash\naws-spend-summary my-costs monthly-reports main-report --days 7\n```\n\n### Export to CSV for Analysis\n\n```bash\naws-spend-summary my-costs reports/daily cost-analysis --csv-output monthly-spend.csv\n```\n\n### Run with Nix (without installing)\n```bash\nnix run nixpkgs#aws-spend-summary -- my-costs reports/daily cost-analysis --threshold 5.00\n```\n\n## Troubleshooting\n\n### Common Issues\n\n\n**\"Unable to read access key from AWS_ACCESS_KEY_ID (or AWS_ACCESS_KEY\"**\n- Check that you have configured AWS credentials following the instructions above\n\n**\"Got 404 when trying to retrieve results...\"**\n- S3 Bucket name may be incorrect\n- Bucket path may be incorrect\n- Cost report name may be incorrect\n\n**\"Access Denied to bucket\"**\n- Check your IAM permissions include both Cost Explorer and S3 access\n- Verify the S3 bucket policy allows your IAM user/role to read objects\n- Verify that the bucket name was typed correctly\n\n### Getting Help\n\nIf you encounter issues:\n1. Check the [GitHub Issues](https://github.com/your-repo/awsspendsummary/issues)\n2. Verify your AWS Cost and Usage Report configuration\n3. Ensure your IAM permissions are correctly set up\n\n## Why This Approach?\n\nUsing Cost and Usage Reports stored in S3 instead of the Cost Explorer API provides several advantages:\n\n- **Cost-effective**: S3 storage costs are minimal compared to API calls\n- **Faster**: Direct S3 access is quicker than API requests\n- **Reliable**: No API rate limits or throttling\n- **Detailed**: Access to raw usage data\n- **Data consolidation**: Automatically merges multiple report files from S3, saving you from manually downloading and combining CSV files\n- **Analysis-ready**: CSV export makes it easy to import into Excel, Google Sheets, or data analysis tools\n\n## 💰 Why Use This Instead of Cost Explorer API?\n\n### 💰 Real-World Cost Savings\n\nMonitoring your AWS costs shouldn't cost more than your actual AWS usage! Here's what you roughly save (depends on the region and prices might change):\n\n| Monitoring Pattern | Cost Explorer API | aws-spend-summary | You Save |\n|-------------------|-------------------|-------------------|----------|\n| Once daily | $0.30/month | \u003c $0.01/month | 97% |\n| Hourly (business hours) | $1.76/month | \u003c $0.08/month | 95% |\n| Every 30 min (business) | $3.52/month | \u003c $0.15/month | 96% |\n| Every hour (24/7) | $5.28/month | \u003c $0.22/month | 96% |\n\nFor a developer checking costs hourly during work hours, that's **$20+ saved per year** - enough for a nice dinner or a few months of a streaming subscription!\n\n### Additional Benefits\n- ✅ **No API rate limits** - Check as often as you want\n- ✅ **More detailed data** - Access individual line items\n- ✅ **Bulk operations** - Analyze multiple days without multiple API calls\n\n### Perfect For\n- 🎓 Students learning AWS\n- 👨‍💻 Developers with personal projects\n- 🚀 Bootstrapped startups watching every penny\n- 🧪 Anyone using AWS free tier who wants to stay within limits\n\n## Contributing\n\nContributions are welcome! Please feel free to submit pull requests or open issues.\n\n[![Hackage package](https://repology.org/badge/version-for-repo/hackage/haskell%3Aaws-spend-summary.svg)](https://repology.org/project/haskell%3Aaws-spend-summary/versions)\n\n\n## License\n\nThis project is licensed under the GNU General Public License v2.0 - see the LICENSE file for details.\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdanielrolls%2Faws-spend-summary","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdanielrolls%2Faws-spend-summary","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdanielrolls%2Faws-spend-summary/lists"}