A curated list of open technology projects to sustain a stable climate, energy supply, biodiversity and natural resources.

Green Cost Explorer

See how much of your cloud bill is spent on fossil fuels, so you can do the right thing and switch.
https://github.com/thegreenwebfoundation/green-cost-explorer

Keywords from Contributors

measure composer transforms archiving conversation observability animations profiles train virtualization

Last synced: over 1 year ago
JSON representation

Acceptance Criteria

Repository metadata

See how much of your cloud bill is spent on fossil fuels ,so you can do the right thing and switch. We're in a climate crisis, remember?

README.md

Green Cost Explorer - climate related spend analysis for AWS

All Contributors

If you work in technology, it's reasonable to think that you have some respect for science.

And if you have some respect for science, then you'll understand why spending a significant chunk of your monthly AWS bills on fossil fuel powered infrastructure isn't a thing we can afford to do anymore.

Because Amazon provide a helpful breakdown of which regions you use run on what they refer to as sustainable power, and which ones do not, and because they provide a cost-explorer tool, you combine this information to get an idea of where you might be spending money on fossil fuels without realising.

You can also just look at this nice cartoon. The ones which are notionally sustainable, have the green leaf next to them:

aws-geek-sustainable-regions

What this does

TODO:

  • Sort your monthly spend into green vs grey spend
  • Create a basic table showing this
  • Show this as a chart
  • Project forward, using AWS's cost projection features, to help you see these against your own commmitments

Usage

Prerequisites

  • Enable AWS Cost Explorer: Simply opening AWS CostExplorer in the AWS console
  • An IAM user with CostExplorer read permissions

AWS Credential access

You can use aws configure to export keys as access, or manually export:

AWS_ACCESS_KEY_ID='YOUR_KEY_ID'
AWS_SECRET_ACCESS_KEY='YOUR_SECRET_ACCESS_KEY'

This is a wrapper around the AWS NodeJS SDK, so by default, it looks for creds in your environment the way the AWS NodeJS normally does. However, you can also set following the environment variables to override these to try it out.
It looks for the AWS credentials in your environment, but if you're not comfortable with this, the AWS SDK lets you pass in credentials in number of ways.

Usage

npx @tgwf/green-cost-explorer

If you have it installed and npm link-ed locally you can run:

npx greencost

If all goes well, you'll get something like this (sample data below):

┌──────────────────────────────┬──────────────────────────────┐
│ Total Green Cost             │ Total Grey Cost              │
├──────────────────────────────┼──────────────────────────────┤
│ 49.0% ($146.66)              │ 51.0% ($152.48)              │
└──────────────────────────────┴──────────────────────────────┘
┌──────────────────────────────┬──────────────────────────────┬──────────────────────────────┐
│ month                        │ Green Cost by month          │ Grey Cost by month           │
├──────────────────────────────┼──────────────────────────────┼──────────────────────────────┤
│ 2018-08-01                   │ 64.8% ($11.55)               │ 35.2% ($6.27)                │
├──────────────────────────────┼──────────────────────────────┼──────────────────────────────┤
│ 2018-09-01                   │ 27.5% ($13.42)               │ 72.5% ($35.47)               │
├──────────────────────────────┼──────────────────────────────┼──────────────────────────────┤
│ 2018-10-01                   │ 66.6% ($13.60)               │ 33.4% ($6.82)                │
├──────────────────────────────┼──────────────────────────────┼──────────────────────────────┤
│ 2018-11-01                   │ 68.0% ($13.59)               │ 32.0% ($6.39)                │
├──────────────────────────────┼──────────────────────────────┼──────────────────────────────┤
│ 2018-12-01                   │ 34.0% ($11.62)               │ 66.0% ($22.54)               │
├──────────────────────────────┼──────────────────────────────┼──────────────────────────────┤
│ 2019-01-01                   │ 52.0% ($19.43)               │ 48.0% ($17.94)               │
├──────────────────────────────┼──────────────────────────────┼──────────────────────────────┤
│ 2019-02-01                   │ 49.4% ($19.64)               │ 50.6% ($20.13)               │
├──────────────────────────────┼──────────────────────────────┼──────────────────────────────┤
│ 2019-03-01                   │ 52.0% ($21.61)               │ 48.0% ($19.92)               │
├──────────────────────────────┼──────────────────────────────┼──────────────────────────────┤
│ 2019-04-01                   │ 56.6% ($22.19)               │ 43.4% ($16.99)               │
└──────────────────────────────┴──────────────────────────────┴──────────────────────────────┘

There are also flags to let you see a breakdown by service as well.

Note: Only infrastructure costs are taken into consideration. Non-infrastructure global costs like Taxes are ignored.

Licensing

Feel free to use this commercially - part of your job as a professional in tech is to avoid unnecessary harm, and burning fossil fuels to run our infrastructure:

  • objectively causes harm
  • is avoidable, by either switching regions, or using a different provider, or contacting AWS about offsetting the emissions from running infra in their non-sustainable regions.

To be honest, given this is all about tracking your own spend, so it's actually pretty hard to make this something you couldn't use for commercial use.

So, Apache 2.0, yo.

Contributors ✨

Thanks goes to these wonderful people (emoji key):

This project follows the all-contributors specification. Contributions of any kind welcome!


Owner metadata


GitHub Events

Total
Last Year

Committers metadata

Last synced: over 1 year ago

Total Commits: 30
Total Committers: 8
Avg Commits per committer: 3.75
Development Distribution Score (DDS): 0.6

Commits in past year: 0
Committers in past year: 0
Avg Commits per committer in past year: 0.0
Development Distribution Score (DDS) in past year: 0.0

Name Email Commits
Franziska Schmidt f****t@m****m 12
Chris Adams c****s@p****k 9
dependabot[bot] 4****] 3
allcontributors[bot] 4****] 2
Jean-Louis Giordano j****s@j****m 1
Franziska Schmidt h****o@f****h 1
Ed Summers e****s@p****m 1
Sam Warner 3****p 1

Committer domains:


Issue and Pull Request metadata

Last synced: over 1 year ago

Total issues: 16
Total pull requests: 25
Average time to close issues: 2 months
Average time to close pull requests: 5 days
Total issue authors: 5
Total pull request authors: 7
Average comments per issue: 1.56
Average comments per pull request: 0.6
Merged pull request: 13
Bot issues: 0
Bot pull requests: 16

Past year issues: 1
Past year pull requests: 0
Past year average time to close issues: N/A
Past year average time to close pull requests: N/A
Past year issue authors: 1
Past year pull request authors: 0
Past year average comments per issue: 0.0
Past year average comments per pull request: 0
Past year merged pull request: 0
Past year bot issues: 0
Past year bot pull requests: 0

More stats: https://issues.ecosyste.ms/repositories/lookup?url=https://github.com/thegreenwebfoundation/green-cost-explorer

Top Issue Authors

  • mrchrisadams (11)
  • vsmart (2)
  • flowirtz (1)
  • wmagda (1)
  • WtfJoke (1)

Top Pull Request Authors

  • dependabot[bot] (14)
  • vsmart (5)
  • allcontributors[bot] (2)
  • Jell (1)
  • flowirtz (1)
  • edsu (1)
  • sjwarner-bp (1)

Top Issue Labels

Top Pull Request Labels

  • dependencies (14)

Dependencies

package-lock.json npm
  • 492 dependencies
package.json npm
  • aws-sdk ^2.503.0
  • cli-table ^0.3.1
  • colors ^1.3.3
  • dotenv ^8.0.0
  • jest ^24.8.0

Score: 7.3264656138403215