anasinnyk / terraform-provider-onepassword

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

Publish provider for use in Terraform 0.13 #39

Closed aicarmic closed 3 years ago

aicarmic commented 4 years ago

👋 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:

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.

Dniwdeus commented 4 years ago

@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. :wink:

aicarmic commented 4 years ago

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.

Dniwdeus commented 3 years ago

https://registry.terraform.io/providers/milosbackonja/1password/latest/docs thx guys! awesome! :tada: :balloon: :fireworks: :grin:

mcmarkj commented 3 years ago

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
adrian-catana commented 3 years ago

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'.

adrian-catana commented 3 years ago

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
}
aicarmic commented 3 years ago

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"
    }
  }
}
throwaway8787 commented 3 years ago

@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 commented 3 years ago

@Dniwdeus - did you make a PR?

anasinnyk commented 3 years ago

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

anasinnyk commented 3 years ago

@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 commented 3 years ago

@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.

aicarmic commented 3 years ago

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

anasinnyk commented 3 years ago

Thanks @aicarmic