ccc

module
v0.0.5 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 13, 2022 License: Apache-2.0

README

ccc - Cloud Cost Checker

license pkg goreportcard 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:

# download
curl -fLROSs https://github.com/kunitsuinc/ccc/releases/download/v0.0.4/ccc_v0.0.4_darwin_arm64.zip

# unzip
unzip -j ccc_v0.0.4_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

Directories

Path Synopsis
cmd
ccc
pkg
log
repository/bigquery
nolint: dupl
nolint: dupl

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL