Coder Social home page Coder Social logo

aws-billing-reporting's Introduction

aws-billing-reporting

Go Report Card

Small serverless service for monthly AWS usage reporting

The service sends notifications in Slack channel with aggregated costs for Billing tag in AWS

Deployment

  1. Copy .env-sample to .env and fill it. You need to specify only (AWS_ACCESS_KEY and AWS_SECRET_ACCESS_KEY) or AWS_PROFILE for terraform. User should be able to create new IAM roles/policies and use Lambda and CloudWatch services
  2. Define TF_VAR_SLACK_WEBHOOK_URL as a Slack incomming webhook URL
  3. Load environment variables

export $(xargs < .env)

  1. Compile and archive lambda function

GOOS=linux go build main.go && zip main.zip main

  1. Deploy serivice to AWS using terraform

cd iac && terraform apply

Schedule can be adjusted by modifying schedule_expression in cost-reporter.tf using rate or cron expressions: AWS Scheduled Events

Slack notification format

2020-05-01 - 2020-06-01
Projects hardware expences (AWS):
project_1: $232.32
project_x: $140.96
project_foo: $102.2

aws-billing-reporting's People

Contributors

garugaru avatar wisprp avatar

Watchers

 avatar  avatar

Forkers

cloudxo

aws-billing-reporting's Issues

Fix Goreportcard warnings

https://goreportcard.com/report/github.com/wisprp/aws-billing-reporting

golint

aws-billing-reporting/main.go
Line 22: warning: exported type SlackRequestBody should have comment or be unexported (golint)
Line 26: warning: exported type BillingRange should have comment or be unexported (golint)
Line 30: warning: exported method BillingRange.DateRangeString should have comment or be unexported (golint)
Line 46: warning: exported function SendReport should have comment or be unexported (golint)
Line 134: warning: exported function BuildSlackMessage should have comment or be unexported (golint)

ineffassign

aws-billing-reporting/main.go
Line 48: warning: ineffectual assignment to err (ineffassign)

misspell

aws-billing-reporting/main.go
Line 121: warning: "projectin" is a misspelling of "projection" (misspell)
Line 140: warning: "expences" is a misspelling of "expense" (misspell)
Line 144: warning: "throught" is a misspelling of "thought" (misspell)

Add more tests

It would be good to add more tests, not only for a one function

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.