Terraform Workflow
The overmind terraform command is the recommended way to use Overmind with Terraform. It wraps your normal terraform plan and terraform apply commands to provide real-time blast radius analysis and risk assessment with minimal workflow changes.
Quick Startβ
Replace your normal Terraform commands with Overmind's equivalents:
# Instead of: terraform plan
overmind terraform plan
# Instead of: terraform apply
overmind terraform apply
That's it. Overmind handles everything else automatically.
How It Worksβ
When you run overmind terraform plan:
- Runs Terraform: Executes
terraform planwith your configuration - Discovers Infrastructure: Queries your cloud accounts for real-time resource data
- Maps Dependencies: Builds a comprehensive view of how resources are interconnected
- Calculates Blast Radius: Identifies all resources that could be affected
- Assesses Risks: Analyzes potential issues and failure points
- Opens Results: Displays the blast radius graph in your browser
When you run overmind terraform apply:
- Takes a "Before" Snapshot: Captures the current state of your infrastructure
- Runs Terraform Apply: Executes the actual apply
- Takes an "After" Snapshot: Captures the new state
- Tracks Outcomes: Links to the change created by
planand provides a diff of everything that changed, including any unexpected repercussions
Commandsβ
overmind terraform planβ
Runs terraform plan and sends the results to Overmind for blast radius and risk analysis.
overmind terraform plan [overmind options...] -- [terraform options...]
What it does:
- Executes
terraform planwith any arguments you provide - Strips sensitive data from the plan output before uploading
- Creates or updates a Change in Overmind
- Calculates the blast radius using real-time infrastructure data
- Displays risks in the terminal with severity levels (High/Medium/Low)
- Opens the blast radius graph in your browser
Example output:
Running `terraform plan`...
Plan Complete! Submitting plan to Overmind...
β
Mapping resources
β
Stripping sensitive data
β
Submitting changes to Overmind
β
Discovering Blast Radius
β
Blast radius graph ready, opening in browser
β
Calculating risks
Plan complete: Expected Changes:
+ aws_instance.web_server
~ aws_security_group.main
- aws_route53_record.old
Blast Radius: Items: 128 Edges: 350
Potential Risks:
- Impact on Target Groups (High π₯): Target groups may be affected if the security group change causes networking issues.
- Impact on Load Balancer Traffic (Medium !): The restriction of egress traffic could affect traffic distribution.
See this change in the graph: https://app.overmind.tech/changes/abc-123-def
overmind terraform applyβ
Runs terraform apply with before/after snapshots for tracking.
overmind terraform apply [overmind options...] -- [terraform options...]
What it does:
- If no plan file is provided, runs
terraform planfirst - Prompts for approval (unless
--auto-approveis passed to Terraform) - Takes a snapshot before and after applying
- Links to the Change created by the previous
plancommand - Provides a diff of all changes, including unexpected impacts
Example:
# Apply with approval prompt
overmind terraform apply
# Apply automatically (skips risk calculation)
overmind terraform apply -- --auto-approve
# Apply a specific plan file
overmind terraform apply -- saved-plan.tfplan
Passing Terraform Argumentsβ
Use -- to separate Overmind options from Terraform arguments:
# Pass variables to terraform
overmind terraform plan -- -var="environment=production"
# Use a variable file
overmind terraform plan -- -var-file=production.tfvars
# Set parallelism
overmind terraform plan -- -parallelism=20
# Combine multiple arguments
overmind terraform plan -- -var-file=prod.tfvars -target=aws_instance.web
Command Optionsβ
Change Metadata Optionsβ
These options add context to your changes:
| Option | Description |
|---|---|
--title | Short title for the change. Auto-generated if not specified. |
--description | Quick description of the change. |
--owner | The owner of this change. |
--ticket-link | Link to the ticket/PR. Used as a unique identifierβmultiple runs with the same link update the same Change. |
--repo | Repository URL. Auto-detected from Git config or CI environment. |
--tags | Tags in key=value format. Can be repeated or comma-separated. |
Examples:
# Add metadata to a change
overmind terraform plan \
--title "Update security groups" \
--description "Restrict egress to port 8080 only" \
--owner "platform-team" \
--ticket-link "https://github.com/org/repo/pull/123"
# Add tags
overmind terraform plan --tags "env=production" --tags "team=platform"
overmind terraform plan --tags "env=production,team=platform"
Connection Optionsβ
| Option | Description | Default |
|---|---|---|
--app | Overmind instance URL | https://app.overmind.tech |
--timeout | How long to wait for responses | 31m |
Change Identification Optionsβ
Use these to link commands to existing changes:
| Option | Description |
|---|---|
--change | Frontend URL of an existing change |
--ticket-link | Link to the ticket for this change |
--uuid | UUID of an existing change |
These options are mutually exclusive.
Source Configuration Optionsβ
| Option | Description |
|---|---|
--only-use-managed-sources | Skip local credential discovery and only use managed sources configured in Overmind |
Code Change Optionsβ
| Option | Description |
|---|---|
--terraform-plan-output | Filename of cached terraform plan output |
--code-changes-diff | Filename of the code diff for this change |
Linking Plan and Applyβ
When you run overmind terraform plan, a Change is created in Overmind. The subsequent overmind terraform apply automatically links to that Change using the --ticket-link identifier.
How linking works:
plancreates a Change with a unique identifier (defaults to a hash of the plan file)applyfinds the Change using the same identifier- Both commands update the same Change record
For CI/CD pipelines, explicitly set --ticket-link to ensure plan and apply are linked:
# In your CI pipeline
TICKET_LINK="${CI_MERGE_REQUEST_URL:-$GITHUB_PR_URL}"
# Plan phase
overmind terraform plan --ticket-link "$TICKET_LINK"
# Apply phase (in a later job)
overmind terraform apply --ticket-link "$TICKET_LINK"
Authenticationβ
Local Developmentβ
On first run, Overmind prompts you to authenticate via browser:
Please sign-up/login at https://app.overmind.tech/signup?code=XXXX-XXXX
Authentication succeeded.
Credentials are cached locally for subsequent runs.
CI/CD Environmentsβ
Set the OVM_API_KEY environment variable with an API key from your account settings:
export OVM_API_KEY="your-api-key-here"
overmind terraform plan
Required API key permissions:
account:readchanges:writeconfig:writerequest:receivesources:readsource:write
Cloud Provider Accessβ
Overmind needs read-only access to discover your infrastructure. There are two approaches:
Automatic (Local Credentials)β
By default, Overmind uses your existing cloud credentials:
# AWS - uses your current profile
export AWS_PROFILE=production
overmind terraform plan
# GCP - uses application default credentials
gcloud auth application-default login
overmind terraform plan
On first run, you'll be prompted to confirm which credentials to use:
Choose how to access your AWS account (read-only):
> Use $AWS_PROFILE (currently: production)
Use a different profile
Use the default settings
Configure managed source (opens browser)
Managed Sourcesβ
For team environments, configure managed sources in the Overmind UI. These provide permanent, centrally-managed access without requiring local credentials.
Use --only-use-managed-sources to skip local credential discovery:
overmind terraform plan --only-use-managed-sources
Complete Workflow Exampleβ
Here's a full example of using Overmind with Terraform:
# Navigate to your Terraform project
cd infrastructure/production
# Make your changes to *.tf files
# ...
# Analyze the impact of your changes
overmind terraform plan \
--title "Scale web tier" \
--ticket-link "https://jira.company.com/INFRA-123"
# Review the blast radius and risks in your browser
# Make any adjustments based on the analysis
# Apply the changes with tracking
overmind terraform apply \
--ticket-link "https://jira.company.com/INFRA-123"
# View the before/after diff in Overmind
Docker Usageβ
The Overmind CLI is available as a Docker container with OpenTofu included:
# Run terraform plan in a container
docker run --rm \
-v $(pwd):/workspace \
-w /workspace \
-e AWS_ACCESS_KEY_ID \
-e AWS_SECRET_ACCESS_KEY \
-e OVM_API_KEY \
ghcr.io/overmindtech/cli:latest \
overmind terraform plan
Configurationβ
When using overmind terraform plan, configuration is managed through your Overmind account settings:
- Blast radius tuning: Configure analysis depth and scope via your account settings
- Signals config: Configure in the Overmind UI to define what constitutes routine vs. high-risk changes
For advanced use cases requiring per-command configuration (local config files, custom blast radius parameters), use overmind changes submit-plan instead. See the CLI Configuration Guide for details.
Troubleshootingβ
"No sources configured"β
Overmind needs access to your cloud accounts to discover infrastructure.
Solution: Either:
- Ensure your cloud credentials are accessible (e.g.,
AWS_PROFILEis set) - Configure managed sources in the Overmind UI
"Blast radius incomplete"β
The blast radius analysis couldn't access all accounts or resources.
Solution:
- Check that your sources have proper read permissions
- Verify all relevant cloud accounts are configured
- Review source logs in the Overmind UI
"Plan parsing failed"β
Terraform plan couldn't be parsed or executed.
Solution:
- Verify
terraform planworks on its own - Ensure you're running from the correct directory
- Check Terraform is properly initialized (
terraform init)
Authentication issues in CI/CDβ
Solution:
- Verify
OVM_API_KEYis set correctly - Check the API key has the required permissions
- Ensure the key hasn't expired
Next Stepsβ
- Learn about blast radius configuration for customized analysis
- Set up GitHub Actions integration for automated PR analysis
- Explore change analysis to understand risk assessment