Skip to content
/ ccc Public

ccc - Cloud Cost Checker collects, calculates, graphs and notifies IaaS costs.

License

Notifications You must be signed in to change notification settings

kunitsucom/ccc

Repository files navigation

ccc - Cloud Cost Checker

license pkg goreportcard workflow workflow codecov sourcegraph

ccc - Cloud Cost Checker collects, calculates, graphs and notifies IaaS costs.

Project Goal

  • Inform you of IaaS costs so that you are aware of sudden cost increases
  • Don't bother opening the console to see costs

Supported

IaaS

  • Google Cloud Platform

Method of saving Cost Graph Image

  • Post to Slack
  • Save to local directory

How to use

1. Slack

1-1. Create Slack Bot and Invite channel

1-2. Download ccc for your execution environment

Download ccc for your execution environment as follows:

VERSION=v0.0.6

# download
curl -fLROSs https://github.com/kunitsucom/ccc/releases/download/${VERSION}/ccc_${VERSION}_darwin_arm64.zip

# unzip
unzip -j ccc_${VERSION}_darwin_arm64.zip '*/ccc'

1-3. Run ccc

# Authenticate with Google User or Service Account that has permissions
# equivalent to `roles/bigquery.dataViewer` and `roles/bigquery.user` in some way.
export GOOGLE_APPLICATION_CREDENTIALS=/path/to/key.json

# Run ccc
./ccc \
  -tz Asia/Tokyo \
  -project your-gcp-project \
  -billing-table your-gcp-project.billing_dataset.gcp_billing_export_v1_FFFFFF_FFFFFF_FFFFFF \
  -billing-project your-gcp-project \
  -message '```your-gcp-project Cost last 30 days (last 30 days)```' \
  -slack-token xoxb-999999999999-9999999999999-ZZZZZZZZZZZZZZZZZZZZZZZZ \
  -slack-channel '#your-bot-invited-channel' \
  -days 30 \
  -debug

It will be posted as follows:

cost

If you want to post cost graphs to Slack on a regular basis

I highly recommend this GitHub Actions: ccc-actions - GitHub Actions for Cloud Cost Checker

TODO

  • IaaS
    • Google Cloud Platform
    • Amazon Web Service
  • Method of saving Cost Graph Image
    • Post to Slack
    • Save to local directory
  • Add tests