Cost Guardrails
Prevent cost overruns by enforcing spend thresholds directly in your deployment pipeline.
Overview
Cost guardrails let you block deployments that would exceed cost thresholds. Define rules based on absolute cost, percentage change, or monthly budget limits, and CostBeacon will evaluate them before infrastructure is provisioned.
Guardrail Types
- AbsoluteCost — triggers when the estimated cost of a deployment exceeds a fixed dollar amount
- PercentageChange — triggers when the deployment would increase costs by more than a percentage relative to current spend
- MonthlyBudget — triggers when the deployment would push the subscription past its monthly budget
Actions
Each guardrail is configured with an action that determines what happens when the threshold is exceeded:
- Block — fail the pipeline and prevent the deployment
- Warn — log a warning but allow the deployment to proceed
- Notify — allow the deployment and send a notification to the configured channel
CI/CD Integration
Integrate guardrails into any CI/CD pipeline by calling the CostBeacon API as a pre-deployment step. The API returns a pass/fail result that your pipeline can use to gate deployments. Works with Azure DevOps, GitHub Actions, GitLab CI, and any system that can make HTTP requests.
Evaluate API
Call the evaluate endpoint with your cost estimates to check guardrails programmatically:
POST /api/guardrails/evaluate
Include the estimated monthly cost and subscription ID in the request body. The response indicates whether the deployment is allowed, along with any triggered guardrails and their configured actions.