Skip to content

Commit 88e7c31

Browse files
Merge branch 'main' of github.com:demeter-run/ext-cardano-ogmios
2 parents dc6b49f + 2f515e3 commit 88e7c31

File tree

3 files changed

+28
-10
lines changed

3 files changed

+28
-10
lines changed

bootstrap/main.tf

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,10 @@ module "ogmios_v1_proxies_blue" {
3535
cloud_provider = var.cloud_provider
3636
cluster_issuer = var.cluster_issuer
3737
dns_zone = var.dns_zone
38+
dns_names = lookup(var.dns_names, each.key, [])
3839
environment = var.proxy_blue_environment
3940
extension_name = var.extension_name
40-
extra_annotations = var.proxy_blue_extra_annotations
41+
extra_annotations = lookup(var.proxy_blue_extra_annotations_by_network, each.value, {})
4142
namespace = var.namespace
4243
proxy_image_tag = var.proxy_blue_image_tag
4344
replicas = var.proxy_blue_replicas
@@ -53,9 +54,10 @@ module "ogmios_v1_proxies_green" {
5354
cloud_provider = var.cloud_provider
5455
cluster_issuer = var.cluster_issuer
5556
dns_zone = var.dns_zone
57+
dns_names = lookup(var.dns_names, each.key, [])
5658
environment = var.proxy_green_environment
5759
extension_name = var.extension_name
58-
extra_annotations = var.proxy_green_extra_annotations
60+
extra_annotations = lookup(var.proxy_green_extra_annotations_by_network, each.value, {})
5961
namespace = var.namespace
6062
proxy_image_tag = var.proxy_green_image_tag
6163
replicas = var.proxy_green_replicas

bootstrap/proxy/main.tf

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ locals {
1313
])
1414

1515
# Add the extra URL to the list of generated URLs
16-
dns_names = var.dns_names != null ? var.dns_names : concat(local.by_version, ["*.${var.extension_name}.${var.dns_zone}"])
16+
dns_names = length(var.dns_names) > 0 ? var.dns_names : concat(local.by_version, ["*.${var.extension_name}.${var.dns_zone}"])
1717
cert_secret_name = var.environment != null ? "${var.extension_name}-${var.environment}-${var.network}-wildcard-tls" : "${var.extension_name}-${var.network}-wildcard-tls"
1818
}
1919

@@ -85,7 +85,7 @@ variable "versions" {
8585

8686
variable "dns_names" {
8787
type = list(string)
88-
default = null
88+
default = []
8989
}
9090

9191
variable "dns_zone" {

bootstrap/variables.tf

Lines changed: 22 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,12 @@ variable "dns_zone" {
77
default = "demeter.run"
88
}
99

10+
variable "dns_names" {
11+
description = "Map of network to list of DNS names"
12+
type = map(list(string))
13+
default = {}
14+
}
15+
1016
variable "cluster_issuer" {
1117
type = string
1218
default = "letsencrypt-dns01"
@@ -100,9 +106,14 @@ variable "proxy_green_replicas" {
100106
default = 1
101107
}
102108

103-
variable "proxy_green_extra_annotations" {
104-
type = map(string)
105-
default = {}
109+
variable "proxy_green_extra_annotations_by_network" {
110+
description = <<EOT
111+
A map where keys are network names (only those defined in the "networks" variable)
112+
and values are maps of extra annotations for the blue proxy service specific
113+
to that network.
114+
EOT
115+
type = map(map(string))
116+
default = {}
106117
}
107118

108119
variable "proxy_green_environment" {
@@ -119,9 +130,14 @@ variable "proxy_blue_replicas" {
119130
default = 1
120131
}
121132

122-
variable "proxy_blue_extra_annotations" {
123-
type = map(string)
124-
default = {}
133+
variable "proxy_blue_extra_annotations_by_network" {
134+
description = <<EOT
135+
A map where keys are network names (only those defined in the "networks" variable)
136+
and values are maps of extra annotations for the blue proxy service specific
137+
to that network.
138+
EOT
139+
type = map(map(string))
140+
default = {}
125141
}
126142

127143
variable "proxy_blue_environment" {

0 commit comments

Comments
 (0)