Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FR] Create resources for managing Providers in the Registry #584

Open
straubt1 opened this issue Aug 1, 2022 · 7 comments
Open

[FR] Create resources for managing Providers in the Registry #584

straubt1 opened this issue Aug 1, 2022 · 7 comments

Comments

@straubt1
Copy link

straubt1 commented Aug 1, 2022

Use-cases

As a TFE self-managed Customer, have the ability to manage providers in the registry with Terraform.

Attempted Solutions

There are several API calls that are required to make this work, but require a fair bit of custom coding.

Proposal

Having a Terraform Provider to support this would remove the need for self managed code to manage these resources.

Basic framework of how this might work.

resource "tfe_registry_provider" "random" {
  name      = "random"
  namespace = "my-org-name"
}

resource "tfe_registry_provider_version" "random" {
  name       = "random"
  namespace  = "my-org-name"
  version    = "3.1.2"
  shasums    = file("SHA256SUMS")
  shasumssig = file("SHA256SUMS.sig")
  gpg_key_id = "51845454656465465"
}

resource "tfe_registry_provider_version_platform" "random_linux" {
  name       = "random"
  namespace  = "my-org-name"
  version    = "3.1.2"
  os         = "linux"
  arch       = "amd64"
  binary     = "./terraform-provider-random_3.1.2_linux_amd64.zip"
}

resource "tfe_registry_provider_version_platform" "random_darwin" {
  name       = "random"
  namespace  = "my-org-name"
  version    = "3.1.2"
  os         = "darwin"
  arch       = "amd64"
  binary     = "./terraform-provider-random_3.1.2_darwin_amd64.zip"
}
@sebasslash
Copy link
Contributor

👋
Thanks for submitting this FR! I think this certainly doable, but it would present some novel functionality to the provider that requires some internal discussion on the best approach.

I don't imagine many customers will be including the binary with their configuration, so we'd most likely have to add support to fetch the zip from some remote source, adding complexity if the source is private.

I'll create a ticket for investigation 👍

@straubt1
Copy link
Author

straubt1 commented Aug 4, 2022

I had similar thoughts as well @sebasslash but figured I would add here to see what the community need was, and allow you all to determine if it was a good idea.

@km274
Copy link

km274 commented Aug 27, 2022

Hey @sebasslash, just commenting to say that I would also love to see this functionality added to the provider, and I'm interested in helping with the implementation as well.

To your point about the added complexity resulting from having to pull the provider binary from some remote source - maybe we could start with a locally-sourced binary like in @straubt1 's example and then add in the ability to pull from a remote source later on? I'm coming at it from the viewpoint that even if it means storing the binaries together with the configuration, I would rather be able to manage the providers through first-class Terraform resources than through custom logic and curl calls.😁

@straubt1
Copy link
Author

@kippmorris7 This is not the solution you are looking for, but might help in the interim.
https://tfx.rocks/commands/registry_provider/#tfx-registry-provider-create

I have been developing this CLI for common TFE/TFC tasks.

@ArjunDandagi
Copy link

ArjunDandagi commented Apr 2, 2023

I stumbled upon this idea recently when someone in our org published to our internal registry.
I would love to have this Feature.
Going forward we may want to extend some publicly available providers for our usecase.

I can take this up with a mentor. 🙏

@kokosnuss
Copy link

We also would love to have this Feature.
@sebasslash is there anything new to say about this FR ?

@tmatilai
Copy link
Contributor

I'm working on adding resources and data sources at least for the GPG keys and providers.

But not sure if Terraform is the best tool for managing the releases. I would like to have an easy integration with e.g. GitHub Actions for that, like with the public providers.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants