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" {