Closed bryanhonof closed 3 months ago
Thank you for raising this. I could reproduce the bug and it's definitely not a desired behavior. We will look into this and come up with a fix as soon as possible.
After looking at the snippet more, I see a misconfiguration:
vault = data.onepassword_vault.vault.id
That ID is a Terraform ID and it does not match the vault ID that you would normally use.
The fix for this is using the uuid
property of the onepassword_vault
data source like so:
vault = data.onepassword_vault.vault.uuid
I will keep this issue open since I've identified some errors in the examples provided so we will improve them as soon as possible.
I had the same issue with uuid
when I was testing this. I will check it once again and come back to you.
same issue even when using uuid
Hey @Antse! 👋
I'm sorry to hear that you're encountering this.
Unfortunately, I'm unable to reproduce the error when the uuid
is used. Here's the snippet I'm using for debugging this:
terraform {
required_providers {
onepassword = {
source = "1Password/onepassword"
version = "~> 2.0"
}
}
}
data "onepassword_vault" "vault" {
name = "demo"
}
resource "onepassword_item" "demo_login" {
vault = data.onepassword_vault.vault.uuid
title = "Demo Terraform Login"
category = "login"
username = "test@example.com"
}
This one succeeds when using a service account for example.
There is a possibility that what you're encountering is rather the 1Password client failing to create an item. However, there's a bug in the code that doesn't handle it properly, which leads to the crash you're facing. This should be addressed by #178.
I too am encountering this same issue. I am on an M1 Mac.
@edif2008 as far I can tell, I think it is a permission issue, give read
only permission and see if you can replicate it
The problem in my case was that the 1password connect server did not have write access to the vault. After I replaced the token with one that had write access, I was able to apply the changes. Hopefully this error message can be fixed to show something more helpful.
Your environment
Terraform Provider Version:
v2.0.0
Connect Server Version:
n/a
CLI Version:
2.24.0
OS:
darwin_arm64
Terraform Version:
v1.8.3
What happened?
What did you expect to happen?
I expected the item to be created in 1password.
Steps to reproduce
Notes & Logs