examples: DEVfromGround vc_org, NODEJS, VM, POSTGRES updates
This commit is contained in:
@@ -0,0 +1,32 @@
|
||||
// Создано: 2026-03-23
|
||||
// main.tf — провайдер Nubes + переменные для примера NODEJS.
|
||||
// Ресурс nubes_nodejs: managed Node.js приложение в облаке (не sless-функция).
|
||||
|
||||
terraform {
|
||||
required_providers {
|
||||
nubes = {
|
||||
source = "terra.k8c.ru/nubes/nubes"
|
||||
version = "5.0.19"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
variable "api_token" {
|
||||
type = string
|
||||
sensitive = true
|
||||
}
|
||||
|
||||
variable "realm" {
|
||||
type = string
|
||||
description = "resource_realm — зона размещения ресурса (например: k8s-3-sandbox-nubes-ru)"
|
||||
}
|
||||
|
||||
variable "git_path" {
|
||||
type = string
|
||||
description = "URL git-репозитория с кодом приложения"
|
||||
}
|
||||
|
||||
provider "nubes" {
|
||||
api_token = var.api_token
|
||||
api_endpoint = "https://deck-api-test.ngcloud.ru/api/v1/index.cfm"
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
# Создано: 2026-03-23
|
||||
# nodejs.tf — ресурс nubes_nodejs: managed Node.js приложение.
|
||||
# Параметры взяты из документации terra.k8c.ru/docs/nubes/nubes/5.0.19/30_registry/resources/nodejs_params_create/
|
||||
|
||||
resource "nubes_nodejs" "app" {
|
||||
resource_name = "nodejsdemo1"
|
||||
domain = "domma"
|
||||
resource_realm = var.realm
|
||||
git_path = var.git_path
|
||||
app_version = "23"
|
||||
resource_c_p_u = 500
|
||||
resource_memory = 1024
|
||||
resource_instances = 1
|
||||
json_env = jsonencode({})
|
||||
adopt_existing_on_create = true
|
||||
# health_path не задан — используется дефолтный /
|
||||
}
|
||||
|
||||
output "nodejs_domain" {
|
||||
description = "Домен развёрнутого Node.js приложения"
|
||||
value = nubes_nodejs.app.domain
|
||||
}
|
||||
Reference in New Issue
Block a user