Giter Site home page Giter Site logo

awsashish / aws-cost-report Goto Github PK

View Code? Open in Web Editor NEW

This project forked from trackit/aws-cost-report

0.0 2.0 0.0 1.63 MB

Generate Sheets (Google, Excel and CSV) with useful information about your AWS spendings.

License: MIT License

Python 99.57% Shell 0.43%

aws-cost-report's Introduction

Cost report generator

Requirements

  • Install jq
  • Install the python3 dependencies: sudo pip3 install -r requirements.txt

Google Sheets API access

Follow the instructions at https://developers.google.com/sheets/api/quickstart/python to setup credentials and API access.

How to run the tool on your machine

# Print help and usage informations
$> ./run.py --help

# Run with one billing bucket and one EC2 profile
$> ./run.py --billing profile_name billing-bucket-name prefix --ec2 profile_name --xlsx-name filename

# Run with multiple billing buckets and EC2 profiles
$> ./run.py --billing profile_name billing-bucket-name prefix --billing profile_name2 billing-bucket-name2 prefix2 --ec2 profile_name --ec2 profile_name2 --xlsx-name filename

The tool is built to use AWS credentials stored in ~/.aws/credentials. If you set the profile to env, the tool will use environment variables you must supply instead.

How to run the tool with docker

The docker container do not export any data to google sheets. However it generates CSVs in the out directory, and a local spreadsheet generation will be added soon.

Use our prebuilt image

# Pull the msolution/aws-cost-report image
$> docker pull msolution/aws-cost-report

Build your own image

# Build your own msolution/aws-cost-report image
$> docker build -t msolution/aws-cost-report .

Use the docker container

# Run with one billing bucket and one EC2 profile, using env credentials
$> docker run -v /local/path/out:/root/aws-cost-report/out -e AWS_ACCESS_KEY_ID=accesskeyid -e AWS_SECRET_ACCESS_KEY=secretaccesskey -e AWS_DEFAULT_REGION=default-region -e AWS_SESSION_TOKEN=sessiontoken(optional) msolution/aws-cost-report --no-generate-sheet --billing env billing-bucket-name prefix --ec2 env --xlsx-name filename

# Run with multiple billing buckets and EC2 profiles, using your local aws credentials
$> docker run -v /path/to/credentials:/root/.aws:ro -v /local/path/out:/root/aws-cost-report/out msolution/aws-cost-report --no-generate-sheet --billing profile_name billing-bucket-name prefix --billing profile_name2 billing-bucket-name2 prefix2 --ec2 profile_name --ec2 profile_name2 --xlsx-name filename

Screenshots

Download the report example here.

Cost and variations tab

Reserved instance summary

Instance size recommendations

EC2 instances last month

aws-cost-report's People

Contributors

lfrancois avatar schubev avatar thibautcornolti avatar zanchi-r avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.