add Node.js CRUD (tfnodejscrud) + nodejs.tf in TEST_STAND

This commit is contained in:
“Naeel”
2026-07-20 13:50:13 +04:00
parent 33c5844ede
commit f56c0c0cf4
3 changed files with 58 additions and 0 deletions
+1
View File
@@ -12,6 +12,7 @@ provider/internal/resources_gen/
# === External repos (managed separately) ===
tfluceecrud/
tfflaskcrud/
tfnodejscrud/
gateway/
generated/
TOOLS/bin/
+10
View File
@@ -42,6 +42,16 @@ locals {
flask_memory = 512
flask_replicas = 1
# ─── Node.js ─────────────────────────────────────────────────────────────
nodejs_git_revision = "1c646c6"
nodejs_resource_name = "nodejscrud"
nodejs_domain = "tfnodejs"
nodejs_git_path = "https://gitea.services.ngcloud.ru/Nail/tfnodejscrud.git"
nodejs_cpu = 300
nodejs_memory = 512
nodejs_replicas = 1
nodejs_timeout = "15m"
# ─── JDBC / БД ───────────────────────────────────────────────────────────
jdbc_class = "org.postgresql.Driver"
jdbc_bundle_name = "org.postgresql.jdbc"
+47
View File
@@ -0,0 +1,47 @@
# =============================================================================
# Node.js — CRUD (та же PG, та же таблица что у Lucee/Flask)
# =============================================================================
locals {
nodejs_pg_host = nubes_postgres.main_pg.state_out_flat["internalMaster"]
nodejs_pg_user = nubes_postgres_user.crud_user_0.username
nodejs_pg_pass = nonsensitive(jsondecode(nubes_postgres.main_pg.vault_secrets["users"]).user4crudpg.password)
nodejs_pg_db = nubes_postgres_database.pg_db.db_name
}
resource "nubes_nodejs" "appnodejs" {
resource_name = local.nodejs_resource_name
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 = "/"
}
git_revision = local.nodejs_git_revision
operation_timeout = local.nodejs_timeout
json_env = jsonencode({
TABLE_NAME = local.crud_table_name
PGHOST = local.nodejs_pg_host
PGPORT = local.pg_port
PGUSER = local.nodejs_pg_user
PGPASSWORD = local.nodejs_pg_pass
PGDATABASE = local.nodejs_pg_db
})
depends_on = [nubes_postgres.main_pg]
}