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
314 stars 41 forks source link

Provider doesn't work with beta CLI version #148

Open volodymyrZotov opened 5 months ago

volodymyrZotov commented 5 months ago

Your environment

Terraform Provider Version: v1.4.1

Connect Server Version: n/a

CLI Version: 2.23.0-beta.01

OS: 13.4.1

Terraform Version: 1.6.4

What happened?

Provider throws an error when using with beta CLI version.

Error: failed to get version of op CLI: Version segment starts with 0 (input is: 2.23.0-beta.01)

What did you expect to happen?

It should work with with beta version.

Steps to reproduce

  1. Install 1Password CLI v2.23.0-beta.01.
  2. Use the following main.tf
    
    # main.tf
    provider "onepassword" {
    account     = "your_account_email"
    op_cli_path = "/usr/local/bin/op"
    }

resource "onepassword_item" "demo_login" { vault = "you_vault_uuid"

title = "Demo Terraform Login" category = "login" username = "test@example.com" }

3. `terraform init`
4. `terraform apply`

## Notes & Logs
`semver` package could not parse the cli beta version `2.23.0-beta.01` and threw an error.

semver.NewVersion(versionString)



The problem is that 1Password CLI releases has `.` between `beta` and `build number`. The version without dot `2.23.0-beta01` is parsed correctly.

We need to find a workaround for that.
mrclrchtr commented 3 months ago

So there is currently no way to use the terraform plugin in combination with the terraform module?