BetterStackHQ / terraform-provider-better-uptime

Apache License 2.0
47 stars 14 forks source link

Remove hyphen from Terraform Registry provider example #16

Open Edeholland opened 2 years ago

Edeholland commented 2 years ago

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 commented 2 years ago

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

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 commented 2 years ago

The name of the repo would need to change.

Edeholland commented 10 months ago

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 commented 10 months ago

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 commented 4 months ago

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 commented 4 months ago

Created a simple copy paste PR to see if Better Stack is open for it; https://github.com/BetterStackHQ/terraform-provider-better-uptime/pull/85