postgres-provisionning/main.tf

95 lines
2.3 KiB
Terraform
Raw Normal View History

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"
2023-12-02 21:50:09 +00:00
collate = "fr_FR.utf8"
ctype = "fr_FR.utf8"
privileges = ["CREATE", "CONNECT", "TEMPORARY"]
}
output "ampere_account" {
2023-12-03 12:03:59 +00:00
value = module.ampere.account
sensitive = true
}
output "cfssl_account" {
2023-12-03 12:03:59 +00:00
value = module.cfssl.account
sensitive = true
}
output "gitea_account" {
2023-12-03 12:03:59 +00:00
value = module.gitea.account
sensitive = true
}
output "keycloak_account" {
2023-12-03 12:03:59 +00:00
value = module.keycloak.account
sensitive = true
}
output "nextcloud_account" {
2023-12-03 12:03:59 +00:00
value = module.nextcloud.account
sensitive = true
}