terraformmozilla-sops

Running terraform plan through sops exec-file


I have an encrypted providers.tfvars.json, so running:

sops exec-file provider.tfvars.json 'terraform plan -var-file={} -out terraform.todo'

I expect terraform to work correctly, but I get an error from terraform:

Error: Argument or block definition required

Decrypting providers.tfvars.json, and running terraform plan -var-file=provider.tfvars.json -out terraform.todo works

I tried sops exec-file --no-fifo to no avail.

Any ideas?


Solution

  • Fixed in sops version 3.7.0 with PR #761

    Terraform needs a filename extension for var files, sops didn’t provide one.