terraform-provider-grafana
terraform-provider-grafana copied to clipboard
Support different alertmanager in resources like grafana_contact_point and grafana_notification_policy
In the current version of provider during creating grafana_contact_point and grafana_notification_policy they will be created in default alertmanager Grafana. But if you have ngalertmanager alertmanger you couldn't choose it. This functionality available in the web gui but not in provider.
This will also require a feature request in Grafana, as it currently stands. The API in Grafana that Terraform calls also does not have the ability to create objects in external alertmanagers.
The core issue here, is that the structure of contact points and other resources is not the same between Grafana and Alertmanager - it's not just an option that would be different, it would need to be a totally different set of resources entirely. Right now we're working on a unification project to bring these into alignment over the next few months.
Once that's done, this should become much easier to tackle, as it'll just be one unified resource definition that works everywhere, rather than two separate contact point structures per system.
I've been trying Grafana Cloud these couple days. And I noticed the Contact Point and Notification Policy is installed to default alertmanager. But the default setup of Grafana Cloud has a second alertmanager ngalertmanager. It took me a while to understand why my setup wasn't working. And my current workaround is resetup whatever I did in Terraform for the ngalertmanager to make things work.
Here is what I observed:
grafana_synthetic_monitoring_check-> second alertmanager ngalertmanagergrafana_contact_point-> default alertmanager Grafanagrafana_notification_policy-> default alertmanager Grafana
I searched the docs, there seem to be no way to pick the alertmanger. I hope there is a better way than re-doing things on web ui.
Same here. I am looking forward to being able to choose alertmanager type.