File tree Expand file tree Collapse file tree
infrastructure/modules/container-app Expand file tree Collapse file tree Original file line number Diff line number Diff 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
Original file line number Diff line number Diff 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+ }
Original file line number Diff line number Diff 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}
You can’t perform that action at this time.
0 commit comments