grafana / terraform-provider-grafana

Terraform Grafana provider
https://www.terraform.io/docs/providers/grafana/
Mozilla Public License 2.0
413 stars 222 forks source link

[Feature] Support SNS contact points in non-Amazon Grafana #1672

Open grodriguezl opened 2 weeks ago

grodriguezl commented 2 weeks ago

Terraform Version

1.6.6

Terraform Grafana Provider Version

3.3.0

Grafana Version

11.2.0

Affected Resource(s)

Terraform Configuration Files

resource "grafana_contact_point" "my_contact_point" {
  name = "my_contact_point"

  sns {
    topic                   = "arn:aws:sns:us-east-2:123456789012:test-grafana"
    access_key              = "Test"
    secret_key              = "Test"
    body                    = "{{ range .Alerts}}{{ .Labels.alertname }}{{ end -}}"
    subject                 = "{{ range .Alerts}}{{ .Labels.alertname }}{{ end -}}"
    disable_resolve_message = false
  }
}

Expected Behavior

Contact point should be created

Actual Behavior

Error: [POST /v1/provisioning/contact-points][400] postContactpointsBadRequest {"message":"invalid object specification: failed to validate integration \"my_contact_point\" (UID ) of type \"sns\": must specify topicArn, targetArn, or phone number"}

It seems the translation from the filed topic to the actual API field is broken

Steps to Reproduce

terraform apply

Important Factoids

No response

References

No response

julienduchesne commented 2 weeks ago

11.2 tells me that this isn't Amazon Managed Grafana, so this isn't exactly a bug, it's just not supported yet. SNS support seems to be new in non-Amazon Grafana

grodriguezl commented 2 weeks ago

It works well when using UI