Skip to content

Commit ad35f7f

Browse files
committed
DTOSS-10700: Use a docker image for the postgres database for the review apps
1 parent c3ed138 commit ad35f7f

3 files changed

Lines changed: 29 additions & 3 deletions

File tree

infrastructure/modules/container-app/main.tf

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,14 +104,30 @@ resource "azurerm_container_app" "main" {
104104

105105
content {
106106
external_enabled = true
107-
target_port = var.http_port
107+
target_port = var.port
108108
allow_insecure_connections = false
109109
traffic_weight {
110110
percentage = 100
111111
latest_revision = true
112112
}
113113
}
114114
}
115+
116+
dynamic "ingress" {
117+
for_each = var.is_tcp_app ? [1] : []
118+
119+
content {
120+
external_enabled = true
121+
target_port = var.port
122+
exposed_port = var.port
123+
allow_insecure_connections = false
124+
transport = "tcp"
125+
traffic_weight {
126+
percentage = 100
127+
latest_revision = true
128+
}
129+
}
130+
}
115131
}
116132

117133
# Enable Microsoft Entra ID authentication if specified

infrastructure/modules/container-app/output.tf

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,7 @@ output "url" {
77
description = "URL of the container app. Only available if is_web_app is true."
88
value = var.is_web_app ? "https://${azurerm_container_app.main.ingress[0].fqdn}" : ""
99
}
10+
11+
output "container_app_fqdn" {
12+
value = azurerm_container_app.main.latest_revision_fqdn
13+
}

infrastructure/modules/container-app/variables.tf

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,8 +69,14 @@ variable "is_web_app" {
6969
default = false
7070
}
7171

72-
variable "http_port" {
73-
description = "HTTP port for the web app. Default is 8080."
72+
variable "is_tcp_app" {
73+
description = "Is this a TCP app? If true, ingress is enabled."
74+
type = bool
75+
default = false
76+
}
77+
78+
variable "port" {
79+
description = "Port for the ingress. Default is 8080."
7480
type = number
7581
default = 8080
7682
}

0 commit comments

Comments
 (0)