anasinnyk / terraform-provider-onepassword

Terraform provider for 1Password
GNU Lesser General Public License v3.0
128 stars 38 forks source link

Not really human readable errors #56

Closed nantiferov closed 3 years ago

nantiferov commented 3 years ago

Hello,

Thank you for this provider, I'm trying to use it as data source for Terraform input values. Not sure if it's related to my environment, but haven't found any similar issue, so decided to create a new one.

So, when OP_SESSION is working, everything is working fine, but when it expired, I just got this error during terraform plan/apply commands:

Error: rpc error: code = Unavailable desc = transport is closing

And the same error I got when trying to lookup non-existing item with datasource.

So my question is: Am I doing something wrong or there are no error messages for expired access and non-existing tokens?

Example code

terraform {
  required_providers {
    onepassword = {
      source  = "anasinnyk/onepassword"
      version = "1.2.1"
    }
  }
}

provider "onepassword" {
  subdomain = "test"
}

data "onepassword_item_password" "this" {
  name = "example-pass-item"
}

resource "example" "this" {
  password =  data.onepassword_item_password.this.password
}

Environment