anasinnyk/terraform-provider-onepassword

Publish provider for use in Terraform 0.13

Closed this issue ยท 14 comments

๐Ÿ‘‹ Hi, I'm on the Terraform Providers team at HashiCorp. With the release of the Terraform 0.13 beta, users can now download and install community providers from the registry. We are inviting provider authors (especially those for popular community providers) to publish their providers in a closed beta.

To get invited to the closed beta, please email terraform-registry-beta@hashicorp.com. We need:

  • A list of GitHub usernames to add to the beta (you and any team members who will publish)
  • List of provider repositories you plan to publish
  • A GPG public key in ASCII-armor format, which you will be using to sign your provider releases

You can use one key for all of your providers, or separate keys if you prefer. If you are publishing from an organization, this key or keys will be associated with that namespace. Once in the beta, you can manage personal keys in the UI as well.

@anasinnyk Do you need any help to apply for the new Terraform registry?
I need to update our company's stack to Terraform 0.13 and yours is the only provider from our stack missing in the new registry ... I won't be able to postpone the transfer any longer and I really need your provider in the registry, so let me know if I can do anything to speed things up for you. ๐Ÿ˜‰

As of 8/10/2020, provider publishing is now generally available to anyone in our community, so that should hopefully make this smooth! All the steps are outlined in our docs.

https://registry.terraform.io/providers/milosbackonja/1password/latest/docs
thx guys! awesome!
๐ŸŽ‰ ๐ŸŽˆ ๐ŸŽ† ๐Ÿ˜

Anyone else facing this issue? Not sure why it's specifying hashicorp/onepassword when in my versions.tf I've specifically put milosbackonja/1password

Screenshot 2020-11-04 at 17 34 03

Anyone else facing this issue? Not sure why it's specifying hashicorp/onepassword when in my versions.tf I've specifically put milosbackonja/1password

Screenshot 2020-11-04 at 17 34 03

I have a similar problem, it seams to me onepassword was uploaded to https://registry.terraform.io with the wrong name of "1password" instead of "onepassword", in https://registry.terraform.io/providers/milosbackonja/1password/latest/docs if you click on "Use provider" we get this instruction:

terraform {
  required_providers {
    1password = {
      source = "milosbackonja/1password"
      version = "1.1.0"
    }
  }
}

provider "1password" {
  # Configuration options
}

this is wrong since required_providers keys can't start with a number, the same with all resouces and data sources:

1password_group
1password_group_member
1password_item_common
1password_item_credit_card
1password_item_document
1password_item_identity
....

this not correct, a name must start with a letter or underscore not '1'.

I got it to partialy work like this:

terraform {
  required_providers {
    onepassword= {
      source = "milosbackonja/1password"
      version = "1.1.0"
    }
  }
}

provider "onepassword" {
  subdomain = var.domain
}

data "onepassword_vault" "vault" {
  provider = onepassword
  name = var.vault_name
}
  • Please note that if you use onepassword inside a module you need to set the required_providers inside that module or else it will try load it from hashicorp/onepassword and fail
  • The subdomain is ignored in above example, this is why it's only partially working (it does work with OP_SUBDOMAIN env variable)
  • you need to specifically set the provider in each data/resource

This is likely the result of Terraform not currently supporting resources/blocks containing numbers. Terraform will default to searching for the provider in the hashicorp/... namespace if a valid one is not specified. If you configure your required_providers as @adrian-catana suggests, it should work (see below). We are looking into ways to address this scenario.

terraform {
  required_providers {
    onepassword = {
      source  = "milosbackonja/1password"
      version = "1.1.0"
    }
  }
}

@aicarmic what's to stop someone from uploading their own version of this, so it automatically downloads from the registry, fetches folks passwords, and uploads them to an intermediary server?

@Dniwdeus - did you make a PR?

https://registry.terraform.io/providers/anasinnyk/onepassword/latest - I published my own. If it fixed this issue please let me know. Thx.

@Dniwdeus thanks for your job. If you can create some PR for fixing some issues about TF 0.13 or any other please feel free.

@aicarmic what's to stop someone from uploading their own version of this, so it automatically downloads from the registry, fetches folks passwords, and uploads them to an intermediary server?

@throwaway8787 It has always been possible to distribute and install any Provider, though the registry intentionally makes this easier. Our official and verified tiers help users make an informed decision, as either HashiCorp or a verified third-party is behind the integration. As with every package manager, the user ultimately assumes responsibility for the dependencies they include. More details on this are included in our terms of use.

https://registry.terraform.io/providers/anasinnyk/onepassword/latest - I published my own. If it fixed this issue please let me know. Thx.

@anasinnyk Working well here!
image