1Password / terraform-provider-onepassword

Use the 1Password Terraform Provider to reference, create, or update items in your 1Password Vaults.
https://1password.com/secrets
MIT License
323 stars 44 forks source link

feat/document on plugin framework #171

Closed sdahlbac closed 3 months ago

sdahlbac commented 4 months ago

This is a re-implementation of #161 due to the upgrading to the new plugin framework.

I have have only tested this with acceptance and cli, as I do not have a connect.

data "onepassword_item" "foo" { vault = var.demo_vault uuid = "..." } resource "local_file" "truststore" { filename = "truststore.jks" content_base64 = data.onepassword_item.foo.file.2.content_base64 } (where 2 is the third file for that item, added via the UI)

I had to use the op read approach rather than op document get (unless I am missing an undocumented feature) to be able to handle multiple files.

I have not tried to implement a resource, since as far as I understood connect cannot support it. I added a validation that you cannot create a new onepassword_item with category document. But the error message does not say why you cannot do it.

(While it sucks a bit having to reimplement this out of the blue, I must say that the first impressions of the newer framework feels nicer to work with.)

Relates: #51

sdahlbac commented 3 months ago

@edif2008 The review comments should be adressed now

sdahlbac commented 3 months ago

@edif2008 done

sdahlbac commented 3 months ago

@edif2008 fixed