API Gateway / Dynamo High Cost

Hey everyone. I have been building a serverless platform for the last few months. I am just starting to create the production environment. I have no users to the site yet but last month my aws was 150$. This month (july) the bill is already at 91$ !! Its only the 3rd. Somehow last night there was 50,000 invocations of my lambda function. Either I messed up, or someone hammered my api.

I am a little worried about opening up the billing console one day and seeing a $1000 charge or something. I’ve gone through the dynamodb and api gateway pricing and from what I understand I am not hitting the numbers to warrant the cost. I’ve hit up AWS support, not helpful so far.

Has anyone else run into billing issues? Does anyone have tips for keeping the cost down ? Even without the 50,000 invocations 150$ for the month when just testing and not having any users is way too much.

DynamoDB costs depends of the IOPS provided, if you’ve reserved 1K IOPS you will pay for 1K IOPS even if you use just 10, I’m running an api that is handling ~35M request per month and the cost do not exceed ~us$120 - $200, so be careful with the IOPS reserved in DynamoDB

Start by looking at which Lambda’s are running and what’s triggering them. If you have no traffic then maybe you’ve accidentally put an infinite loop into your application. For example: You have a Lambda triggered by writing to DynamoDB that’s writing back to DynamoDB triggering the next invocation.