anasinnyk/terraform-provider-onepassword

Authentication bug

Closed this issue · 1 comments

Hi @anasinnyk

I just came back to testing your terraform-provider-1password. I'm using Terraform v0.12.10 and provider.onepassword v0.5.0.

I'm logged into the 1P CLI, and the OP_SESSION_subdomain token exists. Accordingly, I define the provider using:

provider "onepassword" {
  subdomain = "industryvault"
}

When I run terraform apply to create a resource, the operation succeeds! I confirm the success by looking at the 1P GUI and seeing that the operation did succeed. However, I get an additional error message saying "Missing required argument" involving the API key. See the following, for example:

~/G/g/t/m/onepassword-test (master|✚1) $ terraform apply

An execution plan has been generated and is shown below.
Resource actions are indicated with the following symbols:
  + create

Terraform will perform the following actions:

  # onepassword_item_login.this will be created
  + resource "onepassword_item_login" "this" {
      + id       = (known after apply)
      + name     = "iv-testuser1"
      + password = (sensitive value)
      + url      = "https://console.jumpcloud.com"
      + username = "testuser1"
      + vault    = "Team"
    }

Plan: 1 to add, 0 to change, 0 to destroy.

Do you want to perform these actions?
  Terraform will perform the actions described above.
  Only 'yes' will be accepted to approve.

  Enter a value: yes

onepassword_item_login.this: Creating...
onepassword_item_login.this: Creation complete after 1s [id=vhxbzslpq2zfwtulokeapga4ii]

Error: Missing required argument

The argument "api_key" is required, but was not set.

I can apply and destroy resources no problem, but the error message is a little disconcerting.

Thanks
Kyle

Hmmm. Today I'm not getting the error.