This small repo implements a webhook handler that pauses all your vercel projects.
Vercel will bill you for any metered usage traffic that hits your deployments during DDoS attack and Vercel does not offer an automatic spend cap. This means that your costs can potentially sky rocket similar to this story. For more details see:
https://vercel.com/docs/accounts/spend-management
This repo can be deployed directly to vercel, just fork and then add from the Vercel dashboard. Deploy into your personal account and then setup your team's spend management webhook to call the <your-deployment-url>/api/pause endpoint. You will need to configure the following environment variables:
INTEGRATION_SECRETThe signature key vercel shows you when you save the webhook.VERCEL_TEAM_IDYour team id found under Team > Settings > General > Team Id.VERCEL_TOKENToken for authenticating to the vercel REST API found under Settings > Tokens > Create a new token.
You can test the deployed webhook using:
yarn pause --url https://your_deployment_name.vercel.app
yarn unpause --url https://your_deployment_name.vercel.app
This has not yet been tested in production, i.e. called by the vercel spend management webhook and actually paused projects.
Code copied and adapted from https://gist.github.com/borispoehland/2738d2edd62e83f332260a80eb5a9335