From 45c0bc42c5ee44832261ddd5eca9b4588b0e9457 Mon Sep 17 00:00:00 2001 From: Andrea Dell'Amico Date: Mon, 6 Nov 2023 22:46:51 +0100 Subject: [PATCH] Add a CNAME for the alertmanager. --- openstack-tf/common_setups/35-prometheus.tf | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/openstack-tf/common_setups/35-prometheus.tf b/openstack-tf/common_setups/35-prometheus.tf index 8730b5ae..7649fe17 100644 --- a/openstack-tf/common_setups/35-prometheus.tf +++ b/openstack-tf/common_setups/35-prometheus.tf @@ -46,6 +46,7 @@ resource "openstack_compute_floatingip_associate_v2" "prometheus_server" { locals { prometheus_recordset_name = "${var.prometheus_server_data.name}.${var.dns_zone.zone_name}" + alertmanager_recordset_name = "alertmanager.${var.dns_zone.zone_name}" } resource "openstack_dns_recordset_v2" "prometheus_server_recordset" { @@ -56,3 +57,12 @@ resource "openstack_dns_recordset_v2" "prometheus_server_recordset" { type = "A" records = [openstack_networking_floatingip_v2.prometheus_server_ip.address] } + +resource "openstack_dns_recordset_v2" "alertmanager_server_recordset" { + zone_id = var.dns_zone_id + name = local.alertmanager_recordset_name + description = "Prometheus alertmanager" + ttl = 8600 + type = "CNAME" + records = [local.prometheus_recordset_name] +}