Refactor s3 in opentofu to allow internal/external provider selection
This commit is contained in:
parent
9af19f51fa
commit
b336d01858
4 changed files with 5 additions and 42 deletions
modules/infrastructure
|
@ -29,9 +29,7 @@ terraform {
|
|||
|
||||
|
||||
locals {
|
||||
services_auth = {for key, val in var.services : key => val if val.auth}
|
||||
services_database = {for key, val in var.services : key => val if val.database}
|
||||
services_s3 = {for key, val in var.services : key => (val.s3_buckets != null) ? val.s3_buckets : [key] if val.s3}
|
||||
services_s3 = {for key, val in var.services : key => (val.s3_buckets != null) ? val.s3_buckets : [key] if (val.s3 == "external")}
|
||||
buckets_s3 = merge([for key, val in local.services_s3 : {for bucket in val : bucket => key}]...)
|
||||
|
||||
hetzner_hosts = {for key, val in var.hosts : key => val if val.provider == "hetzner"}
|
||||
|
|
|
@ -35,7 +35,7 @@ variable "services" {
|
|||
auth = bool
|
||||
auth_cert = optional(string)
|
||||
auth_redirects = optional(list(string))
|
||||
s3 = bool
|
||||
s3 = optional(string)
|
||||
s3_buckets = optional(list(string))
|
||||
database = bool
|
||||
}))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue