From 71615644580071b1d990f91ce17de59b0fe949c3 Mon Sep 17 00:00:00 2001 From: Matthew Baggett Date: Mon, 8 Jul 2024 17:51:54 +0200 Subject: [PATCH] Expose ports 9000 and 9001 for minio --- minio.tf | 1 + modules/minio/inputs.tf | 5 +++++ modules/minio/minio.tf | 15 +++++++++++++++ 3 files changed, 21 insertions(+) diff --git a/minio.tf b/minio.tf index fa14b94..2dcd068 100644 --- a/minio.tf +++ b/minio.tf @@ -4,4 +4,5 @@ module "minio" { network = docker_network.loadbalancer storage_path = "/media/storage/minio" admin_username = "techinc" + expose_ports = true } diff --git a/modules/minio/inputs.tf b/modules/minio/inputs.tf index fb42ef3..4c13411 100644 --- a/modules/minio/inputs.tf +++ b/modules/minio/inputs.tf @@ -18,3 +18,8 @@ variable "storage_path" { type = string description = "The path to the storage directory to use" } +variable "expose_ports" { + type = bool + description = "Expose the minio ports to the outside world" + default = false +} \ No newline at end of file diff --git a/modules/minio/minio.tf b/modules/minio/minio.tf index cf89f2a..e57ca7a 100644 --- a/modules/minio/minio.tf +++ b/modules/minio/minio.tf @@ -49,6 +49,21 @@ resource "docker_service" "minio" { parallelism = 1 order = "stop-first" } + dynamic "endpoint_spec" { + for_each = var.expose_ports ? toset(["aw yis"]) : toset([]) + content { + ports { + target_port = 9000 + published_port = 9000 + publish_mode = "ingress" + } + ports { + target_port = 9001 + published_port = 9001 + publish_mode = "ingress" + } + } + } } module "minio_nginx_config" {