Compare commits
3 commits
f23b6fbb2f
...
e8a89352e2
Author | SHA1 | Date | |
---|---|---|---|
e8a89352e2 | |||
7dd930d465 | |||
7161564458 |
4 changed files with 38 additions and 0 deletions
1
minio.tf
1
minio.tf
|
@ -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
|
||||||
}
|
}
|
||||||
|
|
|
@ -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
|
||||||
|
}
|
|
@ -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" {
|
||||||
|
|
17
terraform.tf
17
terraform.tf
|
@ -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
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue