Giter Club home page Giter Club logo

sam-aws-cost-slack's Introduction

このリポジトリは?

以下のリポジトリを参考にSAMで動作するように変更した。

https://github.com/tetsuya28/aws-cost-report

何ができるの?

以下のように毎朝9:00に前日のAWS利用料をslackに通知する。

ローカルでテストしたい場合

環境変数にSLACK_TOKENを設定する。

一時的に設定するので、再ログイン時には消えてしまうので注意。

export SLACK_TOKEN=xoxb-...

また、goとして動かしたいときはMakefileを使用するのが便利。

make run

lambdaとして試験する場合はビルドしてからテストする。

build

sam build

テスト。

sam local invoke

AWSにデプロイする前に

パラメータストアにslackのAPIキーを設定すること。

以下のようにパラメータストアから取得している。

      Environment:
        Variables:
            SLACK_TOKEN: '{{resolve:ssm:/SLACK_API_KEY}}'
            SLACK_CHANNEL: information

sam-aws-cost-slack's People

Contributors

yamadatt avatar

Watchers

 avatar

sam-aws-cost-slack's Issues

SecretsManagerを使っており、コストがかかる

現状、毎日0.013ドル使用している。
月額だと0.4ドルかかる。

サラリーマンには致命的な金額なので、コスト低減を図る。

slackのAPIキーはパラメータストアに格納してコスト削減を目指す。

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.