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.
Supports multiple files
Supports text documents and binary documents (provided one uses the content_base64 version)
Roundtrip test:
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.)
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 categorydocument
. 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