terraform-provider-grafana icon indicating copy to clipboard operation
terraform-provider-grafana copied to clipboard

Unable to create contact points - unsupported protocol scheme """

Open RealOrangeOne opened this issue 3 years ago • 2 comments

Terraform Version

  • Terraform: 1.2.7
  • Terraform Grafana Provider: 1.27.0
  • Grafana: 9.1.0

Affected Resource(s)

Please list the resources as a list, for example:

  • grafana_contact_point

If this issue appears to affect multiple resources, it may be an issue with Terraform's core, so please mention this.

Terraform Configuration Files

provider "grafana" {
  cloud_api_url = "https://xxxxxx.grafana.net"
}

resource "grafana_contact_point" "my_contact_point" {
    name = "My Contact Point"

   email {
        addresses = ["[email protected]", "[email protected]"]
        message = "{{ len .Alerts.Firing }} firing."
        subject = "{{ template \"default.title\" .}}"
        single_email = true
        disable_resolve_message = false
    }
}

Debug Output

2022-08-25T12:58:26.603+0100 [INFO]  Starting apply for module.project_grafana.grafana_contact_point.my_contact_point
2022-08-25T12:58:26.604+0100 [DEBUG] module.project_grafana.grafana_contact_point.my_contact_point: applying the planned Create change
2022-08-25T12:58:26.607+0100 [INFO]  provider.terraform-provider-grafana_v1.27.0: 2022/08/25 12:58:26 [ERROR] Grafana API Request error: &errors.errorString{s:"unsupported protocol scheme \"\""}: timestamp=2022-08-25T12:58:26.607+0100
2022-08-25T12:58:31.608+0100 [INFO]  provider.terraform-provider-grafana_v1.27.0: 2022/08/25 12:58:31 [ERROR] Grafana API Request error: &errors.errorString{s:"unsupported protocol scheme \"\""}: timestamp=2022-08-25T12:58:31.607+0100

Panic Output

N/A

Expected Behavior

Contact point created

Actual Behavior

Creation fails with error "Error: Post "/api/v1/provisioning/contact-points": unsupported protocol scheme """

Steps to Reproduce

Please list the steps required to reproduce the issue, for example:

  1. terraform apply

Important Factoids

Grafana is running in Grafana Cloud.

References

N/A

RealOrangeOne avatar Aug 25 '22 12:08 RealOrangeOne

Sorry for the confusion, you need to set url and auth (api key) in your provider to use this resource. I'll be adding better error messages for this today. The cloud_api_url is used for resources prefixed with cloud_

julienduchesne avatar Aug 25 '22 12:08 julienduchesne

I see - thanks! That could also do with being made clearer in the documentation (ideally with a failure to plan)

RealOrangeOne avatar Aug 25 '22 12:08 RealOrangeOne

I've added a validation on all resources. On next version: 1.28.0 (unreleased), it will print out a nicer error message

julienduchesne avatar Aug 25 '22 17:08 julienduchesne