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

Publish Provider to Hashicorp Registry #38

Open
YungBinary opened this issue May 9, 2023 · 1 comment
Open

Publish Provider to Hashicorp Registry #38

YungBinary opened this issue May 9, 2023 · 1 comment

Comments

@YungBinary
Copy link

YungBinary commented May 9, 2023

Context

I am a developer and I am not affiliated with Broadcom but I noticed a need to publish the provider to the Hashicorp Registry, rather than using the binaries locally (I wasn't able to do that successfully after many hours of attempts). I suspect this is due to changes in the latest versions of terraform. I am using terraform 1.4.6.

Temporary Solution

I published 1.1.3 to the Hashicorp registry, see https://registry.terraform.io/providers/YungBinary/luminate/1.1.3

For Luminate users -

Use this in your root module or sub-module's versions.tf:

terraform {
  required_providers {
    luminate = {
      source = "YungBinary/luminate"
      version = "1.1.3"
    }
  }
}

For Broadcom developers -

You might follow this guide to publish the provider: https://developer.hashicorp.com/terraform/tutorials/providers/provider-release-publish

Note, please reference all of the assets I've created at the following link. These assets must be generated manually or via Github Actions in a new release named "vVERSIONHERE" in order for the Hashicorp Registry to "see" them in the repository: https://github.com/YungBinary/terraform-provider-luminate/releases/tag/v1.1.3

If releasing manually and you get to the point where you're using your GPG public key to create the
_terraform-provider-luminate_1.1.3_SHA256SUMS.* files, these commands may be of help to you. First create a folder like "terraform-provider-luminate_1.1.3" in the current working directory, place all of the provider binaries as zip archives named as found in my assets, and finally run these commands:

PROVIDER_BINS_DIR="terraform-provider-luminate_1.1.3"
sumfile="terraform-provider-luminate_1.1.3_SHA256SUMS_SHA256SUMS"
sigfile="terraform-provider-luminate_1.1.3_SHA256SUMS_SHA256SUMS.sig"
sha256sum $PROVIDER_BINS_DIR/* >> ${sumfile}
sed -i "s|$PROVIDER_BINS_DIR/||g" ${sumfile}
gpg --output "${sigfile}" --detach-sig "${sumfile}"

One more thing to keep in mind you might be able to achieve these same results via automation by setting up the go releaser and github actions as described in the documentation from Hashicorp, but in my experience I ran into issues with bundled depencies, accezz specifically in the go source.

@YungBinary YungBinary changed the title Documentation Missing on Installation of Provider Binary Publish Provider to Hashicorp Registry May 10, 2023
@nofearOnline
Copy link

nofearOnline commented Dec 20, 2023

# Updated temporary solution:
terraform {
  required_providers {
    luminate = {
      source = "nofearOnline/luminate"
      version = "1.1.9"
    }
  }
}

provider "luminate" {
  
}

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

No branches or pull requests

2 participants