nrkno / terraform-provider-lastpass

Terraform Lastpass provider
Apache License 2.0
61 stars 7 forks source link

Question: are there any plans to expose the lpass-cli "ls" command #47

Closed mattduguid closed 3 years ago

mattduguid commented 3 years ago

The data source mapping is per secret ID https://registry.terraform.io/providers/nrkno/lastpass/latest/docs/data-sources/lastpass_secret eg:

_data "lastpass_secret" "environment1_secret1" { id = "1234567890123456789" }

We have a large number of secrets to load and wondered if there any plans to expose the lpass-cli "ls" command to allow .getall() type scenarios to reduce code/etc eg:

_lpass ls --format="%aN|%ai|%au|%ap|%al" "environment1_secrets" lpass ls --format="%aN|%ai|%au|%ap|%al" "environment2secrets"

One option is to just use the lpass-cli to write them out to a .tfvars file and pass that in on the terraform cli but something within a provider would be better.

mattduguid commented 3 years ago

After a series of tests eg: read all vars using lastpass-cli, bulk dynamic insert into variables.tf/etc we still found that needing to use them with modules would still require them to be wired in 1 by 1 so this idea of bulk loading is not feasible for now