add Node.js CRUD (tfnodejscrud) + nodejs.tf in TEST_STAND
This commit is contained in:
@@ -12,6 +12,7 @@ provider/internal/resources_gen/
|
|||||||
# === External repos (managed separately) ===
|
# === External repos (managed separately) ===
|
||||||
tfluceecrud/
|
tfluceecrud/
|
||||||
tfflaskcrud/
|
tfflaskcrud/
|
||||||
|
tfnodejscrud/
|
||||||
gateway/
|
gateway/
|
||||||
generated/
|
generated/
|
||||||
TOOLS/bin/
|
TOOLS/bin/
|
||||||
|
|||||||
@@ -42,6 +42,16 @@ locals {
|
|||||||
flask_memory = 512
|
flask_memory = 512
|
||||||
flask_replicas = 1
|
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 / БД ───────────────────────────────────────────────────────────
|
||||||
jdbc_class = "org.postgresql.Driver"
|
jdbc_class = "org.postgresql.Driver"
|
||||||
jdbc_bundle_name = "org.postgresql.jdbc"
|
jdbc_bundle_name = "org.postgresql.jdbc"
|
||||||
|
|||||||
@@ -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]
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user