Description
# Deployment Details
terraform {
required_providers {
coderd = {
source = "coder/coderd"
version = "~> 0.0.8"
}
}
}
provider "coderd" {
url = "coder.****"
token = "******"
}
Very minor issue, but figured that the error outputs could be more informative. When the URL is missing the scheme, it'll fail with:
│ Error: default_organization_id
│
│ with provider["registry.terraform.io/coder/coderd"],
│ on main.tf line 1, in provider "coderd":
│ 1: provider "coderd" {
│
│ failed to get default organization ID: Get "/api/v2/users/me": unsupported protocol scheme ""
At first, I didn't realize that not adding in a URL scheme was invalid per the TF Registry doc's example. I didn't see what was missing until I noticed our coder.com docs showed it. So the registry docs should be updated to match or maybe describe that a scheme should be passed in.
Additionally, if I set the URL to "http://coder.****", it errors out with:
│ Error: default_organization_id
│
│ with provider["registry.terraform.io/coder/coderd"],
│ on main.tf line 1, in provider "coderd":
│ 1: provider "coderd" {
│
│ failed to get default organization ID: invalid character '<' looking for beginning of value
I think this is happening because of the variable CODER_REDIRECT_TO_ACCESS_URL
. My HTTP endpoint is disabled, and my CODER_ACCESS_URL
uses an HTTPS scheme. After disabling it, the provider starts functioning as intended. It looks like the provider isn't following the redirect unless this is intended. I believe this is returning from the provider's side, hence why it's giving an invalid character '<'
error:
jatcod3r ~ % curl -X GET http://coder.******
<a href="https://coder.******">Temporary Redirect</a>.