Compare commits

..

3 commits

Author SHA1 Message Date
e8a89352e2 fmt
Some checks failed
Trunk Check / Trunk Check Runner (push) Failing after 2s
2024-07-08 17:57:53 +02:00
7dd930d465 Add s3 backend store 2024-07-08 17:57:39 +02:00
7161564458 Expose ports 9000 and 9001 for minio 2024-07-08 17:51:54 +02:00
4 changed files with 38 additions and 0 deletions

View file

@ -4,4 +4,5 @@ module "minio" {
network = docker_network.loadbalancer network = docker_network.loadbalancer
storage_path = "/media/storage/minio" storage_path = "/media/storage/minio"
admin_username = "techinc" admin_username = "techinc"
expose_ports = true
} }

View file

@ -18,3 +18,8 @@ variable "storage_path" {
type = string type = string
description = "The path to the storage directory to use" 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
}

View file

@ -49,6 +49,21 @@ resource "docker_service" "minio" {
parallelism = 1 parallelism = 1
order = "stop-first" 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" { module "minio_nginx_config" {

View file

@ -1,5 +1,6 @@
terraform { terraform {
required_version = "~> 1.6" required_version = "~> 1.6"
required_providers { required_providers {
docker = { docker = {
source = "kreuzwerker/docker" source = "kreuzwerker/docker"
@ -18,4 +19,20 @@ terraform {
version = "0.4.0" version = "0.4.0"
} }
} }
backend "s3" {
bucket = "terraform"
key = "ti-iac.tfstate"
profile = "techinc-tf"
shared_credentials_files = ["~/.aws/credentials"]
endpoints = {
s3 = "http://california.ti:9000"
}
region = "main" # Region validation will be skipped
skip_credentials_validation = true # Skip AWS related checks and validations
skip_requesting_account_id = true
skip_metadata_api_check = true
skip_region_validation = true
use_path_style = true # Enable path-style S3 URLs (https://<HOST>/<BUCKET> https://developer.hashicorp.com/terraform/language/settings/backends/s3#use_path_style
}
} }