2022-05-26 15:31:39 +00:00
2022-06-16 15:53:38 +00:00
resource " gandi_livedns_record " " mongo_gateways " {
2022-05-26 15:31:39 +00:00
count = var . mongo_groups_count
zone = var . domain_name
2022-06-16 15:53:38 +00:00
name = " gateway ${ count . index } . ${ var . subdomain_suffix } "
2022-05-26 15:31:39 +00:00
type = " A "
ttl = 3600
2022-06-16 15:53:38 +00:00
values = [ openstack_compute_instance_v2 . mongo_gateways [ count . index ] . access_ip_v4 ]
2022-05-26 15:31:39 +00:00
}
2022-06-16 15:53:38 +00:00
resource " gandi_livedns_record " " mongo_servers " {
count = var . mongo_replicas_count * var . mongo_groups_count
2022-05-26 15:31:39 +00:00
zone = var . domain_name
2022-06-16 15:53:38 +00:00
name = " mongo ${ openstack_compute_instance_v2 . mongo_servers [ count . index ] . metadata . mongo_group_id } - ${ openstack_compute_instance_v2 . mongo_servers [ count . index ] . metadata . mongo_group_index } . ${ var . subdomain_suffix } "
2022-05-26 15:31:39 +00:00
type = " A "
ttl = 3600
values = [ openstack_compute_instance_v2 . mongo_servers [ count . index ] . access_ip_v4 ]
}