terraform-provider-sops icon indicating copy to clipboard operation
terraform-provider-sops copied to clipboard

Return structured data rather than flattening

Open james-callahan opened this issue 2 years ago • 4 comments

Currently all data is flattened. I'd rather have full structured data for my e.g. yaml document

james-callahan avatar Jan 13 '23 08:01 james-callahan

Hi @james-callahan, This is not possible with the Terraform plugin SDK, sadly.

However, Hashicorp released a new provider framework just a few weeks ago which appears to have some more possibilities around complex types, but I have not yet had time to investigate how complicated a migration is.

carlpett avatar Jan 15 '23 09:01 carlpett

Wow, just i was looking for this. Because pushing the data from the sops file to vault because is flattened, is not possible.

NicolasTobias avatar Mar 14 '23 09:03 NicolasTobias

how it is going? any foreseeable estimation?

NicolasTobias avatar Apr 13 '23 15:04 NicolasTobias

As a workaround, you might try this approach:

data "sops_file" "secrets" {
  source_file = "secrets.encrypted.json"
}

locals {
  secrets = jsondecode(data.sops_file.secrets.raw)
}

basvd avatar Nov 28 '23 14:11 basvd