oxid plan

Preview infrastructure changes before applying them. Shows what Oxid will create, update, delete, or replace.

Usage

oxid plan [flags]

The plan command compares your .tf configuration against the current state and real infrastructure, then displays a detailed diff of all planned changes. No infrastructure is modified.

Change Symbols

Oxid uses Terraform-compatible symbols to indicate the type of each change:

  + create    - Resource will be created
  ~ update    - Resource will be updated in-place
  - destroy   - Resource will be destroyed
  -/+ replace - Resource must be destroyed and recreated (forces new)

Example Output

$ oxid plan

Refreshing state for 12 resources...

Oxid will perform the following actions:

  + aws_s3_bucket.logs
      bucket        = "acme-logs-prod"
      force_destroy = false
      tags          = {
        Environment = "production"
        Team        = "platform"
      }

  ~ aws_security_group.web
      description: "Allow HTTP" => "Allow HTTP and HTTPS"
      ingress:     (1 rule added)

  -/+ aws_instance.api (bucket_name changed, forces replacement)
      ami:           "ami-0abcdef1234567890" => "ami-0fedcba9876543210"
      instance_type: "t3.medium" (unchanged)

  - aws_s3_bucket.deprecated

Plan: 1 to add, 1 to change, 1 to replace, 1 to destroy.

State Refresh

By default, Oxid refreshes the state of all managed resources by querying each provider before planning. This ensures the plan reflects the actual state of your infrastructure, catching any out-of-band changes.

To skip the refresh (faster, but may miss drift):

oxid plan --no-refresh

Flags

FlagDescriptionDefault
--target <address>Limit the plan to a specific resource and its dependencies.all resources
--jsonOutput the plan in machine-readable JSON format.false
--no-refreshSkip refreshing state from providers before planning.false
--destroyGenerate a plan to destroy all managed resources.false
--out <file>Save the plan to a file for later use with oxid apply.-

Targeted Plans

Use --target to plan changes for a specific resource and its transitive dependencies:

oxid plan --target aws_instance.api
WarningTargeted plans may miss changes to resources outside the target set. Use them for debugging, not production workflows.

JSON Output

The --json flag outputs a structured JSON representation of the plan, suitable for scripting and CI pipelines:

$ oxid plan --json | jq '.changes[] | {address, action}'

{"address": "aws_s3_bucket.logs", "action": "create"}
{"address": "aws_security_group.web", "action": "update"}
{"address": "aws_instance.api", "action": "replace"}
{"address": "aws_s3_bucket.deprecated", "action": "delete"}

Saving Plans

Save a plan to a file and apply it later to ensure the exact same changes are applied:

oxid plan --out plan.oxid
oxid apply plan.oxid

Destroy Plan

Preview the destruction of all managed resources:

$ oxid plan --destroy

Oxid will perform the following actions:

  - aws_instance.api
  - aws_security_group.web
  - aws_s3_bucket.logs
  - aws_vpc.main

Plan: 0 to add, 0 to change, 4 to destroy.