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

Remove hyphen from Terraform Registry provider example #16

Open
Edeholland opened this issue Dec 13, 2021 · 7 comments
Open

Remove hyphen from Terraform Registry provider example #16

Edeholland opened this issue Dec 13, 2021 · 7 comments

Comments

@Edeholland
Copy link

Under the USE PROVIDERS button in the Terraform Registry, the following code block appears:

terraform {
  required_providers {
    better-uptime = {
      source = "BetterStackHQ/better-uptime"
      version = "0.3.6"
    }
  }
}

provider "better-uptime" {
  # Configuration options
}

This hyphen breaks Terraform init because better-uptime is not a known provider:

│ Error: Failed to query available provider packages
│
│ Could not retrieve the list of available versions for provider hashicorp/betteruptime: provider registry registry.terraform.io does not have a provider named
│ registry.terraform.io/hashicorp/betteruptime
│
│ All modules should specify their required_providers so that external consumers will get the correct providers when using a module. To see which modules are currently depending
│ on hashicorp/betteruptime, run the following command:
│     terraform providers
@adikus
Copy link
Contributor

adikus commented Dec 15, 2021

@Edeholland Thanks for bringing this to our attention! Are you familiar with how we can change this? I'm having trouble figuring where to configure this.

@Edeholland
Copy link
Author

I suspect that part of the documentation is generated by the Terraform registry itself, since it's the same for every provider. It might use the provider name as the local name in the example, but this is speculation.

@leetrout
Copy link

The name of the repo would need to change.

@Edeholland
Copy link
Author

Now that the name of the service has been renamed from Betteruptime to Uptime, this might be a good time to rename the repository.

@mcarrerewelcomr
Copy link

Never to late to fix it. This is a pain regardless of the medium (laptop or runner) and it's not that easy to upgrade your provider.

@fancybear-dev
Copy link
Contributor

fancybear-dev commented May 6, 2024

Just for those finding this issue;

terraform {
  required_providers {
    betteruptime = {
      source = "BetterStackHQ/better-uptime"
      version = "0.3.6"
    }
  }
}

provider "betteruptime" {
  # Configuration options
}

Above works.

The required_providers block must be included for every module that has a Better Stack Uptime resource, otherwise you'll have said error again.

I suggest Better Stack updates their example usage to prevent headaches for beginner users at https://registry.terraform.io/providers/BetterStackHQ/better-uptime/latest/docs#example-usage as that's what I suspect most users will look at.

The notation is present in the GitHub readme file here; https://github.com/BetterStackHQ/terraform-provider-better-uptime#installation

@fancybear-dev
Copy link
Contributor

Created a simple copy paste PR to see if Better Stack is open for it; #85

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

No branches or pull requests

5 participants