Coder Social home page Coder Social logo

aws-billing-notification-tools's Introduction

aws-billing-notification-tool

Commands

export AWS_PROFILE=<your aws profile>

#コマンドでWebhookを使場合は設定(option)
export TEAMS_WEBHOOK_URL=<your teams webhook URL>

#実行例
% python app_shell.py   
------------------------------------------------------
11/01~11/29のクレジット適用後費用は、205.66 (USD)です。
- AWS Config: 31.21
- AWS Cost Explorer: 2.30
- AWS Secrets Manager: 0.01
- AWS Security Hub: 2.55
- EC2 - Other: 115.99
- Amazon Elastic Compute Cloud - Compute: 17.65
- Amazon Elastic Container Service: 5.90
- Amazon GuardDuty: 0.42
- Amazon Relational Database Service: 8.07
- Amazon Simple Storage Service: 0.61
- AmazonCloudWatch: 1.93
- Tax: 19.02
------------------------------------------------------
11/01~11/29のクレジット適用前費用は、431.12 (USD)です。
- AWS Config: 31.21
- AWS Cost Explorer: 5.25
- AWS Secrets Manager: 0.01
- AWS Security Hub: 3.12
- EC2 - Other: 115.99
- Amazon Elastic Compute Cloud - Compute: 73.81
- Amazon Elastic Container Service: 5.90
- Amazon GuardDuty: 0.42
- Amazon Relational Database Service: 173.03
- Amazon Simple Notification Service: 0.82
- Amazon Simple Storage Service: 0.61
- AmazonCloudWatch: 1.93
- Tax: 19.02
------------------------------------------------------

Deploy Script

AWS SAMを用いたビルド&デプロイスクリプト。

#!/bin/sh
set -eu

#aws-root
AWS_PROFILE=root
S3_BACKET=<your backet name>
TEAMS_WEBHOOK_URL=<Teams Webhook URL>

echo "Start sam build command."
sam build

echo "Start sam package command."
sam package \
    --output-template-file packaged.yaml \
    --s3-bucket $S3_BACKET

echo "Start sam deploy command."
sam deploy \
    --template-file packaged.yaml \
    --stack-name NotifyBillingToTeams \
    --capabilities CAPABILITY_IAM \
    --parameter-overrides TeamsWebhookUrl=$TEAMS_WEBHOOK_URL

Delete Stack

sam delete --stack-name NotifyBillingToTeams

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.