Terraspin / 2026 Filed under Infrastructure · Automation Open Source · MIT Docs EN
Download Star

Configuration

Create `.terraspin.yml` in your Terraform workspace. All sections are optional.

Create .terraspin.yml in your Terraform workspace. All sections are optional.

Full reference

version: 1 llm: provider: claude # claude | openai | ollama model: claude-sonnet-4-6 # model name (provider default if omitted) fallback_to_rules: true # fall back to rule-based if LLM call fails risk: fail_on: high # exit code 1 if risk >= critical|high|medium|low rules: - id: no-public-rds severity: critical description: "Database must not be publicly accessible" match: resource_type_pattern: "*_db_instance" attribute_path: "publicly_accessible" value: true - id: prod-deletion-gate severity: critical description: "Deletions in production require manual approval" match: action: delete workspace_pattern: "prod-*" slack: webhook_url_env: SLACK_WEBHOOK_URL notify_on: [critical, high]

LLM config

FieldDefaultDescription
providerclaudeLLM provider
modelclaude-sonnet-4-6Model name
timeout30sAPI call timeout
max_retries2Retries on transient failure
fallback_to_rulestrueUse rule-based narrative if LLM fails

Rules

Each rule has:

FieldRequiredDescription
idyesUnique rule identifier
severityyescritical / high / medium / low
descriptionyesHuman-readable explanation
matchyesConditions (at least one required)

Match conditions:

ConditionExampleDescription
resource_type_pattern*_db_instanceGlob match against resource type
attribute_pathpublicly_accessibleCheck a resource attribute value
valuetrueValue to match against attribute_path
containsprodSubstring match on attribute_path value
actiondeleteMatch by change action
workspace_patternprod-*Glob match against terraform workspace name

If a rule matches, the resource’s risk tier escalates to the rule’s severity (never downgrades).

Risk config

FieldDescription
fail_oncritical / high / medium / low. Overridden by --fail-on flag.

Slack config

FieldDescription
webhook_url_envEnv var containing the webhook URL
notify_onRisk tiers that trigger a notification
channel(reserved)

Notifications fire when SLACK_WEBHOOK_URL (or the custom env var) is set and the overall plan risk matches one of notify_on tiers.

Documentation
On this page