From a8c92f599af671d3366186dbe5b858e9c92a5900 Mon Sep 17 00:00:00 2001
From: Matthew Baggett <matthew@baggett.me>
Date: Mon, 3 Mar 2025 15:51:18 +0100
Subject: [PATCH] ports declarations should support publish_mode

---
 docker/service/inputs.tf           | 7 ++++---
 products/docker_registry/inputs.tf | 7 ++++---
 products/expose/inputs.tf          | 7 ++++---
 products/minio/inputs.tf           | 7 ++++---
 products/mqtt/inputs.tf            | 7 ++++---
 products/socket-proxy/inputs.tf    | 7 ++++---
 6 files changed, 24 insertions(+), 18 deletions(-)

diff --git a/docker/service/inputs.tf b/docker/service/inputs.tf
index b8071d9..7e14ffa 100644
--- a/docker/service/inputs.tf
+++ b/docker/service/inputs.tf
@@ -130,9 +130,10 @@ variable "remote_configs" {
 }
 variable "ports" {
   type = list(object({
-    host      = optional(number, null)
-    container = number
-    protocol  = optional(string, "tcp")
+    host         = optional(number, null)
+    container    = number
+    protocol     = optional(string, "tcp")
+    publish_mode = optional(string, "ingress")
   }))
   default     = []
   description = "A map of port mappings to expose on the host. The key is the host port, and the value is the container port."
diff --git a/products/docker_registry/inputs.tf b/products/docker_registry/inputs.tf
index 6a23d45..172af8b 100644
--- a/products/docker_registry/inputs.tf
+++ b/products/docker_registry/inputs.tf
@@ -55,9 +55,10 @@ variable "networks" {
 }
 variable "ports" {
   type = list(object({
-    host      = optional(number, null)
-    container = number
-    protocol  = optional(string, "tcp")
+    host         = optional(number, null)
+    container    = number
+    protocol     = optional(string, "tcp")
+    publish_mode = optional(string, "ingress")
   }))
   default     = [{ container = 5000 }]
   description = "A map of port mappings to expose on the host. The key is the host port, and the value is the container port."
diff --git a/products/expose/inputs.tf b/products/expose/inputs.tf
index bc1e85b..e851eaf 100644
--- a/products/expose/inputs.tf
+++ b/products/expose/inputs.tf
@@ -37,9 +37,10 @@ variable "mounts" {
 }
 variable "ports" {
   type = list(object({
-    host      = optional(number, null)
-    container = number
-    protocol  = optional(string, "tcp")
+    host         = optional(number, null)
+    container    = number
+    protocol     = optional(string, "tcp")
+    publish_mode = optional(string, "ingress")
   }))
   default = []
 }
\ No newline at end of file
diff --git a/products/minio/inputs.tf b/products/minio/inputs.tf
index d173aa6..1de6704 100644
--- a/products/minio/inputs.tf
+++ b/products/minio/inputs.tf
@@ -49,9 +49,10 @@ variable "remote_volumes" {
 }
 variable "ports" {
   type = list(object({
-    host      = optional(number, null)
-    container = number
-    protocol  = optional(string, "tcp")
+    host         = optional(number, null)
+    container    = number
+    protocol     = optional(string, "tcp")
+    publish_mode = optional(string, "ingress")
   }))
   default = []
 }
diff --git a/products/mqtt/inputs.tf b/products/mqtt/inputs.tf
index 7291fa8..7d3e5f0 100644
--- a/products/mqtt/inputs.tf
+++ b/products/mqtt/inputs.tf
@@ -37,9 +37,10 @@ variable "mounts" {
 }
 variable "ports" {
   type = list(object({
-    host      = optional(number, null)
-    container = number
-    protocol  = optional(string, "tcp")
+    host         = optional(number, null)
+    container    = number
+    protocol     = optional(string, "tcp")
+    publish_mode = optional(string, "ingress")
   }))
   default = []
 }
\ No newline at end of file
diff --git a/products/socket-proxy/inputs.tf b/products/socket-proxy/inputs.tf
index 3e57b1e..dfac704 100644
--- a/products/socket-proxy/inputs.tf
+++ b/products/socket-proxy/inputs.tf
@@ -44,9 +44,10 @@ variable "target" {
 }
 variable "ports" {
   type = list(object({
-    host      = optional(number, null)
-    container = number
-    protocol  = optional(string, "tcp")
+    host         = optional(number, null)
+    container    = number
+    protocol     = optional(string, "tcp")
+    publish_mode = optional(string, "ingress")
   }))
   default = []
 }
\ No newline at end of file