50 lines
1.0 KiB
Terraform
50 lines
1.0 KiB
Terraform
resource "nubes_postgres" "main_pg" {
|
|
resource_name = local.pg_resource_name
|
|
|
|
startup_configuration = {
|
|
resource_realm = var.realm
|
|
}
|
|
|
|
cluster_configuration = {
|
|
cpu = local.pg_cpu
|
|
memory = local.pg_memory
|
|
replicas = local.pg_replicas
|
|
disk = local.pg_disk
|
|
}
|
|
|
|
access_configuration = {
|
|
master_ip_space = "no-needed"
|
|
master_access_list = jsonencode(["10.0.0.0/8"])
|
|
slave_ip_space = "no-needed"
|
|
slave_access_list = jsonencode([])
|
|
}
|
|
|
|
postgres_configuration = {
|
|
version = local.pg_version
|
|
ssl_required = true
|
|
pooler_master = false
|
|
pooler_slave = false
|
|
}
|
|
|
|
postgres_conf = jsonencode([{
|
|
param_name = "log_connections"
|
|
param_value = ""
|
|
}])
|
|
|
|
backup_configuration = {
|
|
s3_uid = var.s3_name
|
|
retain = local.pg_retain
|
|
schedule = local.pg_schedule
|
|
}
|
|
|
|
autoscale_configuration = {
|
|
enabled = false
|
|
schedule = 0
|
|
percent = 10
|
|
quota = 100
|
|
}
|
|
|
|
operation_timeout = local.pg_timeout
|
|
adopt_existing_on_create = true
|
|
}
|