terraform { required_version = ">= 1.0.4, < 2.0.0" required_providers { postgresql = { source = "cyrilgdn/postgresql" version = ">= 1.21.0" } } backend "s3" { endpoint = "http://s3.localdomain" key = "postgres.tfstate" bucket = "terraform" region = "FR" skip_credentials_validation = true skip_region_validation = true skip_metadata_api_check = true shared_credentials_file = "~/.aws/credentials" profile = "minio" force_path_style = true } } provider "postgresql" { host = "database.localdomain" port = 5432 database = var.postgres.db username = var.postgres.user password = var.postgres.secret sslmode = "disable" connect_timeout = 15 } module "ampere" { source = "./generic-database" database_name = "ampere" username = "ampere_user" } module "cfssl" { source = "./generic-database" database_name = "cfssl" username = "cfssl" collate = "en_US.utf8" ctype = "en_US.utf8" } module "gitea" { source = "./generic-database" database_name = "gitea_db" username = "gitea" collate = "fr_FR.UTF-8" ctype = "fr_FR.UTF-8" privileges = ["CREATE", "CONNECT", "TEMPORARY"] } module "keycloak" { source = "./generic-database" database_name = "keycloak" username = "keycloak" collate = "fr_FR.utf8" ctype = "fr_FR.utf8" privileges = ["CREATE", "CONNECT", "TEMPORARY"] } module "nextcloud" { source = "./generic-database" database_name = "nextcloud" username = "nextcloud" collate = "fr_FR.UTF-8" ctype = "fr_FR.UTF-8" } output "ampere_account" { value = jsonencode(module.ampere.account) sensitive = true } output "cfssl_account" { value = jsonencode(module.cfssl.account) sensitive = true } output "gitea_account" { value = jsonencode(module.gitea.account) sensitive = true } output "keycloak_account" { value = jsonencode(module.keycloak.account) sensitive = true } output "nextcloud_account" { value = jsonencode(module.nextcloud.account) sensitive = true }