Terraform and OpenTofu Validator
Offline validation of Terraform and OpenTofu modules with tofu validate and tflint inside the zero-egress iac sandbox.
- Kind
- Validator
- Version
- 2.0.0
- Tier
- verified
- Needs Faber
- v2.0.0+
- Digest prefix
- sha256:47eab19d
Contract facts
- Variant
- iac
- Network
- none
- no egress and no Secrets
- Mode
- image
- Profiles
- 1
- opentofu
Install
Inspect the contract and RBAC delta
$ faberctl catalog inspect validators/iac-opentofu-terraform \ --source oci://ghcr.io/faberops/catalog:v2Render into your GitOps repository
$ faberctl catalog install validators/iac-opentofu-terraform \ --source oci://ghcr.io/faberops/catalog:v2 \ --out-dir ./kubernetes/apps/faber/configOr apply straight to the cluster
$ faberctl catalog install validators/iac-opentofu-terraform \ --source oci://ghcr.io/faberops/catalog:v2 \ --applyHow it works
- Variant:
iac - Image:
ghcr.io/faberops/faber-sandbox-iac:2.0.0 - Profiles:
opentofu - Tools:
tofu,tflint,git
Use it
Bind the validator on a Repository. Playbooks that open pull requests declare the variant they need under spec.requires.validator, and Faber refuses to open a pull request until the sandbox verdict passes.
Notes
OpenTofu reads Terraform HCL, so one image validates both Terraform and OpenTofu repositories. Providers must be vendored or mirrored because the sandbox has no egress. Faber never runs plan or apply against real state. Every validator runs in an ephemeral gVisor sandbox with no Secrets, no service account token and no egress.
Manifest, ready to apply
apiVersion: faberops.dev/v1beta1
kind: Repository
metadata:
name: example-iac
namespace: faber
spec:
kind: iac
url: https://github.com/example-org/example-iac
forge:
provider: github
owner: example-org
repo: example-iac
githubApp:
secretRef:
name: faber-github-app
key: privateKey
validator:
mode: image
image: ghcr.io/faberops/faber-sandbox-iac:2.0.0
profiles:
- opentofu
command:
- 'tofu init -backend=false -input=false'
- 'tflint --recursive'
timeout: 5m
guardrails:
maxChangedFiles: 10
maxChangedLines: 250
secretScan: true
requireValidation: true
# Catalog metadata for validators/iac-opentofu-terraform. Not applied to the cluster.
apiVersion: catalog.faberops.dev/v2
kind: CatalogPack
metadata:
name: iac-opentofu-terraform
category: validators
version: 2.0.0
spec:
tier: verified
minFaberVersion: v2.0.0
digest: sha256:47eab19d21a2defe9125327c02125d21ec57c68de2c6fa5349d6f4f83c35c38c
Copy it into kubectl apply -f -, or let faberctl catalog install render it with provenance annotations into your GitOps path.
Related packs
All 176 packsTerraform and OpenTofu Registry Datasource
connectors/datasource-terraform-registryRead-only Terraform and OpenTofu provider and module registry datasource with conditional caching for zero-cost IaC version tracking.Can readGKE Config Connector Drift and Reconciliation Fixer
playbooks/gke-config-connector-fixerDiagnoses unready GKE Config Connector (cnrm.cloud.google.com) resources such as StorageBucket, SQLInstance, PubSubTopic, and IAMPolicyMember, opening small HITL GitOps pull requests to repair schema, reference, and immutable-field errors.Default HITLCeiling HITLBring Your Own Container App Validator
validators/app-container-byoLanguage-agnostic application validation that runs your own container image and command in the zero-egress sandbox.Variant byo