grafana/crossplane-provider-grafana

Unable to use a custom oncall_url

azkore opened this issue · 2 comments

We have Grafana Cloud in EU West (Belgium) region. When trying to apply a crossplane resource (for example, EscalationChain), there is an error:

Message: apply failed: POST https://oncall-prod-us-central-0.grafana.net/oncall/api/v1/escalation_chains/: 403 {detail: Invalid token.} - the region in the url is the default one.

With terraform we specify oncall_url (https://registry.terraform.io/providers/grafana/grafana/latest/docs#oncall_url) in the provider configuration, like this:

provider "grafana" {
  oncall_url = "https://oncall-prod-eu-west-0.grafana.net/oncall/"
  oncall_access_token = "***************************"
}

but adding it to provider credentials has no effect, it seems it's missed from this list:

for _, k := range []string{
"url",
"auth",
"cloud_api_key",
"cloud_api_url",
"oncall_access_token",
"sm_access_token",
"sm_url",
} {

Is there any workaround to specify a non-default region oncall url?

Feel free to open a PR to add it to the list you linked above, I'll be happy to do a release

@julienduchesne sure, please take a look: #21