60 lines
1.7 KiB
Terraform
60 lines
1.7 KiB
Terraform
locals {
|
|
pg_host = nubes_postgres.main_pg.state_out_flat["internalMaster"]
|
|
pg_user = nubes_postgres_user.crud_user_0.username
|
|
pg_pass = nonsensitive(jsondecode(nubes_postgres.main_pg.vault_secrets["users"]).user4crudpg.password)
|
|
pg_db = nubes_postgres_database.pg_db.db_name
|
|
}
|
|
|
|
resource "nubes_lucee" "applucee" {
|
|
resource_name = local.lucee_resource_name
|
|
|
|
startup_configuration = {
|
|
resource_realm = var.realm
|
|
}
|
|
|
|
cluster_configuration = {
|
|
cpu = local.lucee_cpu
|
|
memory = local.lucee_memory
|
|
replicas = local.lucee_replicas
|
|
}
|
|
|
|
access_configuration = {
|
|
domain = local.lucee_domain
|
|
}
|
|
|
|
app_configuration = {
|
|
version = local.lucee_version
|
|
git_path = local.lucee_git_path
|
|
}
|
|
|
|
git_revision = local.lucee_git_revision
|
|
|
|
json_env = jsonencode({
|
|
TABLE_NAME = local.crud_table_name
|
|
testds_class = local.jdbc_class
|
|
testds_bundleName = local.jdbc_bundle_name
|
|
testds_bundleVersion = local.jdbc_bundle_version
|
|
testds_connectionString = "jdbc:postgresql://${local.pg_host}:5432/${local.pg_db}"
|
|
testds_username = local.pg_user
|
|
testds_password = local.pg_pass
|
|
testds_connectionLimit = local.jdbc_conn_limit
|
|
testds_liveTimeout = local.jdbc_live_timeout
|
|
testds_validate = local.jdbc_validate
|
|
|
|
PGHOST = local.pg_host
|
|
PGPORT = local.pg_port
|
|
PGUSER = local.pg_user
|
|
PGPASSWORD = local.pg_pass
|
|
PGSSLMODE = local.pg_ssl_mode
|
|
DATABASE_URL = format(
|
|
"postgresql://%s:%s@%s:5432/%s",
|
|
local.pg_user,
|
|
local.pg_pass,
|
|
local.pg_host,
|
|
local.pg_db
|
|
)
|
|
})
|
|
|
|
depends_on = [nubes_postgres.main_pg]
|
|
}
|