Skip to content

marcelmeulemans/pause-vercel-projects

Repository files navigation

Pause Vercel Projects

This small repo implements a webhook handler that pauses all your vercel projects.

Why

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

How

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_SECRET The signature key vercel shows you when you save the webhook.
  • VERCEL_TEAM_ID Your team id found under Team > Settings > General > Team Id.
  • VERCEL_TOKEN Token for authenticating to the vercel REST API found under Settings > Tokens > Create a new token.

Testing

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

Disclaimer

This has not yet been tested in production, i.e. called by the vercel spend management webhook and actually paused projects.

Acknowledgements

Code copied and adapted from https://gist.github.com/borispoehland/2738d2edd62e83f332260a80eb5a9335

About

Webhook for pausing your vercel projects to avoid overspending

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published