Skip to content

complyform scan

Discover existing Terraform resources from state files or live cloud APIs.

Terminal window
complyform scan [options]
FlagTypeDefaultDescription
--sourcestate|apistateScan source: local/remote state file or live cloud API
--statepath (multi-value)Path to state file. Repeat for multiple. Supports gs://, s3://, azure://, app.terraform.io/org/ws
--discoverpathRecursive state file discovery in directory. Mutually exclusive with --state and --batch. Max 50 files. (SPEC-001)
--discover-patternstring*.tfstateGlob pattern for --discover
--projectstringCloud project ID (for --source=api)
--orgstringOrg ID — include org-level resources (for --source=api)
--cloudgcp|aws|azuregcpTarget cloud provider
--credentialspathPer-invocation credential override
--batchpathBatch manifest YAML — up to 10 projects (Agency tier)
--parallelint1Concurrent scans in batch mode (max 5)
--assessboolfalseChain scan + assess in one command. Passes through all assess flags.
--frameworksstringUsed with --assess: comma-separated framework IDs

Scan a local state file:

Terminal window
complyform scan --state=terraform.tfstate

Scan a remote GCS state file (Pro+):

Terminal window
complyform scan --state=gs://my-bucket/terraform.tfstate

Scan a live GCP project via cloud API (Team+):

Terminal window
complyform scan --source=api --project=my-gcp-project --cloud=gcp

Discover state files in a monorepo (SPEC-001):

Terminal window
complyform scan --discover=./environments/

Chain scan and assess in one command:

Terminal window
complyform scan --state=terraform.tfstate --assess --frameworks=soc2
  • assess — Map scanned resources to framework controls
  • remediate — Generate patches for failing controls
  • validate — Confirm patches pass compliance checks