- locals.tf: crud-flask → flask-crud, crud-lucee → lucee-crud, crud-nodejs → nodejs-crud; - json_env: SERVICE_NAME = flask/lucee/nodejs (без -crud) — это значение пишется приложением в колонку created_by таблицы crud_items; - terraform validate — Success. Код приложений (DDL created_at/created_by + INSERT + UI) — в репозиториях tfflaskcrud/tfnodejscrud/tfluceecrud (origin переключён на terraform/*): e5fce97, 23338cb, ffcd0c0.
47 lines
1.4 KiB
Terraform
47 lines
1.4 KiB
Terraform
# =============================================================================
|
|
# Node.js — Express-приложение (CRUD, та же БД и таблица, что у Lucee/Flask)
|
|
# =============================================================================
|
|
#
|
|
# Креды БД приходят из файла apps/creds.json (см. apps/locals.tf).
|
|
# =============================================================================
|
|
|
|
resource "nubes_nodejs" "appnodejs" {
|
|
resource_name = local.nodejs_resource_name
|
|
|
|
adopt_existing_on_create = true
|
|
|
|
startup_configuration = {
|
|
resource_realm = var.realm
|
|
}
|
|
|
|
cluster_configuration = {
|
|
cpu = local.nodejs_cpu
|
|
memory = local.nodejs_memory
|
|
replicas = local.nodejs_replicas
|
|
}
|
|
|
|
access_configuration = {
|
|
domain = local.nodejs_domain
|
|
}
|
|
|
|
app_configuration = {
|
|
version = "22"
|
|
git_path = local.nodejs_git_path
|
|
health_path = "/"
|
|
}
|
|
|
|
operation_timeout = local.nodejs_timeout
|
|
|
|
json_env = jsonencode({
|
|
TABLE_NAME = local.crud_table_name
|
|
# SERVICE_NAME — значение колонки created_by («кто добавил строку»).
|
|
SERVICE_NAME = "nodejs"
|
|
PGHOST = local.pg_host
|
|
PGPORT = local.pg_port
|
|
PGUSER = local.pg_user
|
|
PGPASSWORD = local.pg_pass
|
|
PGDATABASE = local.pg_db
|
|
PGSSLMODE = local.pg_ssl
|
|
})
|
|
}
|