0.0.4 • Published 3 years ago

@architect/plugin-budget-watch v0.0.4

Weekly downloads
-
License
Apache-2.0
Repository
github
Last release
3 years ago

@architect/plugin-budget-watch

GitHub CI status

There are many ways a serverless app could run up your bill. Maybe you hit the top of hacker news, or you might have an infinite loop. The simplest way to stop a runaway app is to shut down the compute resources. By setting reserved concurrency (how many simultaneous executions can run) on all lambdas to zero, you can effectively stop the app. The budget-watch plugin can be added to an Architect app to accomplish this.

Install

npm i @architect/plugin-budget-watch

Add these lines to your Architect project manifest:

# app.arc
@plugins
architect/plugin-budget-watch
    
@budget
limit $40
email "notify@example.com"

Once deployed, there is a budget alert scoped to just the resources of the app. If the cost of those resources exceeds the limit set, a shutdown is triggered. To restart the app, the budget limit can be increased or removed and the app redeployed. This resets the lambda concurrencies, and the app will resume operation.