infracost_cloud_create_guardrail
Create cost guardrails to notify stakeholders or block pull requests when infrastructure spending exceeds defined thresholds, helping control cloud costs.
Instructions
Create cost guardrails in Infracost Cloud that notify stakeholders or block PRs when cost thresholds are exceeded. Requires INFRACOST_SERVICE_TOKEN environment variable.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| orgSlug | No | Organization slug from Infracost Cloud (defaults to INFRACOST_ORG env var) | |
| name | Yes | Name for the guardrail | |
| scope | Yes | Scope configuration | |
| increaseThreshold | No | Threshold for cost increases (monthly dollar amount) | |
| increasePercentThreshold | No | Threshold for cost increases (percentage) | |
| totalThreshold | No | Threshold for total cost (monthly dollar amount) | |
| message | No | Custom message to display when threshold is exceeded | |
| webhookUrl | No | Webhook URL to notify when threshold is exceeded | |
| blockPullRequest | No | Whether to block PR when threshold is exceeded | |
| commentOnPullRequest | No | Whether to comment on PR when threshold is exceeded |
Input Schema (JSON Schema)
{
"properties": {
"blockPullRequest": {
"description": "Whether to block PR when threshold is exceeded",
"type": "boolean"
},
"commentOnPullRequest": {
"description": "Whether to comment on PR when threshold is exceeded",
"type": "boolean"
},
"increasePercentThreshold": {
"description": "Threshold for cost increases (percentage)",
"type": "number"
},
"increaseThreshold": {
"description": "Threshold for cost increases (monthly dollar amount)",
"type": "number"
},
"message": {
"description": "Custom message to display when threshold is exceeded",
"type": "string"
},
"name": {
"description": "Name for the guardrail",
"type": "string"
},
"orgSlug": {
"description": "Organization slug from Infracost Cloud (defaults to INFRACOST_ORG env var)",
"type": "string"
},
"scope": {
"description": "Scope configuration",
"properties": {
"projects": {
"description": "Project names (for PROJECT scope)",
"items": {
"type": "string"
},
"type": "array"
},
"repositories": {
"description": "Repository names (for REPO scope)",
"items": {
"type": "string"
},
"type": "array"
},
"type": {
"description": "Scope type for the guardrail",
"enum": [
"ALL_PROJECTS",
"REPO",
"PROJECT"
],
"type": "string"
}
},
"required": [
"type"
],
"type": "object"
},
"totalThreshold": {
"description": "Threshold for total cost (monthly dollar amount)",
"type": "number"
},
"webhookUrl": {
"description": "Webhook URL to notify when threshold is exceeded",
"type": "string"
}
},
"required": [
"name",
"scope"
],
"type": "object"
}