As far as I know, there's no way you can automatically kill it. Of course, you can setup billing / execution alerts, which would probably be very helpful in at least notifying you that there's a problem (I personally have an alert set up to notify me if my estimated charges are anything out of the ordinary).
A small anecdote: Lambda processes are _very_ cheap most of the time. When I was writing the initial version of this starter module, I accidentally threw the lambda into an infinite loop. It was triggered about 30k times within a minute or so and ended up costing around 13 cents if I remember correctly.
So it seems like Lambda is too risky of an option because of the potential for catastrophic failure. It would probably make more sense to try and work with something like Elastic Beanstalk or a lone EC2 instance Im trying to avoid a large amount of time being taken up by doing server administration. As I mentioned in the other post a new hobby tier Heroku Dyno and DB at around 19$ a month is possible within my budget if they make launching a node backend for my app significantly easier. I know this is getting off topic from the OP but any guidance from HN would be appreciated.
How is that your conclusion? If you set up proper monitoring, you'll be notified and able to turn things off by the time you've been cost $10. I would hardly call that catastrophic...
If I missed the notification that an infinite loop was costing 13 cents a minute by the end of the day I am out almost 190$. I know the rational that Amazon has is that you would want to scale your service if you were adding hundreds of people in a single day but thats a lot less likely than an error in my code flushing a relatively considerable amount of money down the toilet. If that was not a risk though I would be using Lambda, it otherwise seems like my best option. Backend is not my forte though so if the point seems crazy I'm willing to consider any advice.
AWS will send billing alert notifications via SNS. Theoretically, you could write a script to listen to the alert queue and shut down processing if you breach a pre-defined threshold.
Of course, you then need to make sure your billing script successfully terminates any processes that are costing money.
I'd love to see AWS implement hard cost limits for services like this. e.g. specify you want to spend a maximum of $10/day, and once you reach that limit your service is temporarily suspended.
A small anecdote: Lambda processes are _very_ cheap most of the time. When I was writing the initial version of this starter module, I accidentally threw the lambda into an infinite loop. It was triggered about 30k times within a minute or so and ended up costing around 13 cents if I remember correctly.