diff --git a/TEST_STAND/LUCEE/lucee.tf b/TEST_STAND/LUCEE/lucee.tf new file mode 100644 index 0000000..f2750f2 --- /dev/null +++ b/TEST_STAND/LUCEE/lucee.tf @@ -0,0 +1,57 @@ +locals { + pg_host = nubes_postgres.npg_lucee.state_out_flat["internalMaster"] + pg_user = nubes_postgres_user.crud_user_0.username + pg_pass = jsondecode(nubes_postgres.npg_lucee.vault_secrets["users"]).user4crudpg.password + pg_db = nubes_postgres_database.pg_db.db_name +} + +resource "nubes_lucee" "applucee" { + resource_name = "luceeresource" + + startup_configuration = { + resource_realm = var.realm + } + + cluster_configuration = { + cpu = 300 + memory = 512 + replicas = 1 + } + + access_configuration = { + domain = "tflucee" + } + + app_configuration = { + version = "5.4" + git_path = "https://gitea.services.ngcloud.ru/Nail/tfluceecrud.git" + } + + json_env = jsonencode({ + TABLE_NAME = "check_point" + testds_class = "org.postgresql.Driver" + testds_bundleName = "org.postgresql.jdbc" + testds_bundleVersion = "42.6.0" + testds_connectionString = "jdbc:postgresql://${local.pg_host}:5432/${local.pg_db}" + testds_username = local.pg_user + testds_password = local.pg_pass + testds_connectionLimit = "5" + testds_liveTimeout = "15" + testds_validate = "false" + + PGHOST = local.pg_host + PGPORT = "5432" + PGUSER = local.pg_user + PGPASSWORD = local.pg_pass + PGSSLMODE = "require" + 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.npg_lucee] +} diff --git a/TEST_STAND/LUCEE/lucee.tf0 b/TEST_STAND/LUCEE/lucee.tf0 deleted file mode 100644 index 56a562d..0000000 --- a/TEST_STAND/LUCEE/lucee.tf0 +++ /dev/null @@ -1,50 +0,0 @@ -resource "nubes_lucee" "app1" { - resource_name = "lucy_0" - - startup_configuration = { - resource_realm = var.realm - } - - cluster_configuration = { - cpu = 300 - memory = 512 - replicas = 1 - } - - access_configuration = { - domain = "tflucee" - } - - app_configuration = { - version = "5.4" - git_path = "https://github.com/xahys/testlucee" - } - - json_env = jsonencode({ - # 🔗 Настройки Data Source 'testds' для Lucee (Application.cfc) - testds_class = "org.postgresql.Driver" - testds_bundleName = "org.postgresql.jdbc" - testds_bundleVersion = "42.6.0" - testds_connectionString = "jdbc:postgresql://${nubes_postgres.npg_lucee.state_out_flat["internalConnect.master"]}:5432/postgres" - testds_username = nubes_postgres.npg_lucee.vault_secrets["adminUser"] - testds_password = nubes_postgres.npg_lucee.vault_secrets["adminPass"] - testds_connectionLimit = "5" - testds_liveTimeout = "15" - testds_validate = "false" - - # 🐘 Переменные окружения для Lucee (доступны через GetEnv) - PGHOST = nubes_postgres.npg_lucee.state_out_flat["internalConnect.master"] - PGPORT = "5432" - PGUSER = nubes_postgres.npg_lucee.vault_secrets["adminUser"] - PGPASSWORD = nubes_postgres.npg_lucee.vault_secrets["adminPass"] - PGSSLMODE = "require" - DATABASE_URL = format( - "postgresql://%s:%s@%s:5432/postgres", - nubes_postgres.npg_lucee.vault_secrets["adminUser"], - nubes_postgres.npg_lucee.vault_secrets["adminPass"], - nubes_postgres.npg_lucee.state_out_flat["internalConnect.master"] - ) - }) - - depends_on = [nubes_postgres.npg_lucee] -} diff --git a/TEST_STAND/LUCEE/main.tf b/TEST_STAND/LUCEE/main.tf index d6d6b24..bb25099 100644 --- a/TEST_STAND/LUCEE/main.tf +++ b/TEST_STAND/LUCEE/main.tf @@ -2,7 +2,7 @@ terraform { required_providers { nubes = { source = "registry.kube5s.ru/nubes-test/nubes" - version = "5.1.10" + version = "5.1.12" } } } diff --git a/TEST_STAND/LUCEE/userUNDdb.tf b/TEST_STAND/LUCEE/userUNDdb.tf new file mode 100644 index 0000000..103844b --- /dev/null +++ b/TEST_STAND/LUCEE/userUNDdb.tf @@ -0,0 +1,17 @@ +# ============================================================================= +# PostgreSQL — пользователи (6 шт.) +# ============================================================================= +resource "nubes_postgres_user" "crud_user_0" { + postgres_id = nubes_postgres.npg_lucee.id + username = "user4crudpg" + role = "ddl_user" + adopt_existing_on_create = true +} + +resource "nubes_postgres_database" "pg_db" { + postgres_id = nubes_postgres.npg_lucee.id + db_name = "db4crudpg" + db_owner = nubes_postgres_user.crud_user_0.username + adopt_existing_on_create = true +} + diff --git a/tfluceecrud b/tfluceecrud new file mode 160000 index 0000000..d623f21 --- /dev/null +++ b/tfluceecrud @@ -0,0 +1 @@ +Subproject commit d623f21cd372df16928cbfc396f18c327a8fc63b