Add a CNAME for the alertmanager.

This commit is contained in:
Andrea Dell'Amico 2023-11-06 22:46:51 +01:00
parent 4482ef3920
commit 45c0bc42c5
Signed by untrusted user: andrea.dellamico
GPG Key ID: 147ABE6CEB9E20FF
1 changed files with 10 additions and 0 deletions

View File

@ -46,6 +46,7 @@ resource "openstack_compute_floatingip_associate_v2" "prometheus_server" {
locals { locals {
prometheus_recordset_name = "${var.prometheus_server_data.name}.${var.dns_zone.zone_name}" 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" { resource "openstack_dns_recordset_v2" "prometheus_server_recordset" {
@ -56,3 +57,12 @@ resource "openstack_dns_recordset_v2" "prometheus_server_recordset" {
type = "A" type = "A"
records = [openstack_networking_floatingip_v2.prometheus_server_ip.address] 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]
}