Code Monkey home page Code Monkey logo

aws_cur_processor's Introduction

AWS Cost and Usage Report Processor

This project provides a set of tools to download, parse, and convert AWS Cost and Usage Reports (CUR) to JSON format. It is designed to help users analyze their AWS usage and costs more effectively.

Project Structure

  • aws_cur_processor/: Main package containing the source code.
    • scripts/: Helper scripts
      • Terraform/: Location for Terraform files
        • CUR_Dashboard.tf : Creation of a pre-made AWS Cost and Utilization (CUR) dashboard
    • src/: Source code directory for the project modules.
      • aws_s3_client.py: Module to handle AWS S3 interactions.
      • csv_parser.py: Module to parse CSV files.
      • json_converter.py: Module to convert CSV data to JSON format.
    • tests/: Directory containing test cases for the project modules.
  • .gitignore: Git ignore file specifying untracked files and directories.
  • README.md: Markdown file providing information about the project (this file).

Setup

To set up the project, follow these steps:

  1. Clone the repository:

    git clone [email protected]:jaycdave88/aws_cur_processor.git
  2. Navigate to the project directory:

    cd aws_cur_processor
  3. Create a virtual environment (optional but recommended):

    python -m venv myenv
    source myenv/bin/activate  # On Windows use `myenv\Scripts\activate`
  4. Install the required dependencies:

    pip install -r requirements.txt

Usage

To use the AWS CUR processor, you need to have AWS credentials set up with access to the S3 bucket where your CUR files are stored.

  1. Set your AWS credentials as environment variables:

    export AWS_ACCESS_KEY_ID=your_access_key
    export AWS_SECRET_ACCESS_KEY=your_secret_key
    export AWS_DEFAULT_REGION=your_region
  2. Run the main script to process the CUR files:

    python main.py

The script will download the CUR file from the specified S3 bucket, parse the CSV data, convert it to JSON, and save the output to a file named output.json.

Parameters

When calling main_function, you need to provide the following parameters:

  • bucket_name: The name of the AWS S3 bucket where the CUR file is stored.
  • s3_file_path: The path to the CUR file within the S3 bucket.
  • local_file_path: The local path where the CUR file will be downloaded.
  • access_key: Your AWS access key ID.
  • secret_key: Your AWS secret access key.
  • region: The AWS region where the S3 bucket is located.

Note: For local processing, only the local_file_path parameter is required. For S3 processing, bucket_name, s3_file_path, access_key, secret_key, and region are required.

Contributing

Contributions to the aws_cur_processor project are welcome. Please feel free to submit pull requests or create issues for bugs and feature requests.

License

This project is licensed under the MIT License - see the LICENSE file for details.

aws_cur_processor's People

Contributors

jaycdave88 avatar obs-gh-jaydave 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.