DEV Community

leroykayanda
leroykayanda

Posted on

1

A lambda that sends daily AWS bill notifications

The SMS/Email will be as below.

AWS Account
Yesterday Usage : Kshs. 730
Month To Date Bill : Kshs. 12,640
Forecasted Bill : Kshs. 20,479

The code is on github.

This helps you keep track of your AWS spending in order to avoid surprises at the end of the month

How it works
It uses cost explorer APIs to get your bill details and then sends them using SNS.

IAM permissions required for the lambda role
cost explorer
sns

How to set it up
Create a python lambda function
Initialize the environment variables
Schedule the lambda function to run periodically using CloudWatch events

Lambda Environment Variables

Image description

currency : name of your local currency e.g kshs
dollar_exchange_rate : the function converts from dollars to your local currency
sns_topic : arn of your sns topic
subject : subject of the message that is sent

Image of Timescale

🚀 pgai Vectorizer: SQLAlchemy and LiteLLM Make Vector Search Simple

We built pgai Vectorizer to simplify embedding management for AI applications—without needing a separate database or complex infrastructure. Since launch, developers have created over 3,000 vectorizers on Timescale Cloud, with many more self-hosted.

Read full post →

Top comments (0)

Postmark Image

Speedy emails, satisfied customers

Are delayed transactional emails costing you user satisfaction? Postmark delivers your emails almost instantly, keeping your customers happy and connected.

Sign up