Code Monkey home page Code Monkey logo

aws_get_bill_report's Introduction

workflow

Script for getting billing data from AWS Cost Explorer

How to use

Install dependencies

pip3 install -r requirements.txt 

To use AWS profile (profile must be configured, this option is only available with console report )

python3 ./get_bill.py --profile=rei-prod --month=06 --year=2022 --report-to-console --no-report-to-file

To make report and write it to the exel file

This is the default behavior, the application will read information from an excel file in the folder report (first two columns) and request billing data from AWS

python3 ./get_bill.py --month=06 --year=2022

this command will add a new column for each project with date and amount

!!! Make sure that you have created a report file with projects and account ids (you can copy the template file), this file uses as source data.

Script arguments

Name Description Default
--profile AWS profile to get access to the Cost Explorer default
--month The report will be created for this month 01
--year The report will be created for this year 2022
--report-to-file If true, will create exel report in folder report True
--report-to-console If true, will print report to console False

Exel output example

report

Console output example

+-------------+-----------------------+--------+------+
| ProjectName | TimePeriod            | Amount | Unit |
+-------------+-----------------------+--------+------+
| rei-prod    | 2022:05:01-2022:06:01 | 5.69   | USD  |
+-------------+-----------------------+--------+------+

+-------------------------------------+-------+------+-------------------------+
| Service                             | Total | Unit | TimePeriod              |
+-------------------------------------+-------+------+-------------------------+
| AWS Key Management Service          | 0.0   | USD  | 2022-05-01 - 2022-06-01 |
| Amazon EC2 Container Registry (ECR) | 0.0   | USD  | 2022-05-01 - 2022-06-01 |
| Amazon Elastic Load Balancing       | 4.37  | USD  | 2022-05-01 - 2022-06-01 |
| Amazon Route 53                     | 1.01  | USD  | 2022-05-01 - 2022-06-01 |
| Amazon Simple Storage Service       | 0.32  | USD  | 2022-05-01 - 2022-06-01 |
| AmazonCloudWatch                    | 0.0   | USD  | 2022-05-01 - 2022-06-01 |
| Tax                                 | 0.0   | USD  | 2022-05-01 - 2022-06-01 |
+-------------------------------------+-------+------+-------------------------+

aws_get_bill_report's People

Contributors

ei-roslyakov avatar

Watchers

 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.