feat(vm): add vApp + VM terraform example

This commit is contained in:
Naeel
2026-03-25 08:17:08 +03:00
parent 3404af578b
commit bc0e00acca
10 changed files with 482 additions and 1 deletions
+32
View File
@@ -0,0 +1,32 @@
# Создано: 2026-04-10
# functions.tf — sless_service ресурсы для примера POSTGRES.
# Здесь: два калькуляторa — Python и Node.js.
# sless_service = long-running Deployment + постоянный URL (в отличие от sless_function).
# ─── Python-калькулятор ──────────────────────────────────────────────────────
resource "sless_service" "calc_python" {
name = "calc-python"
runtime = "python3.11"
entrypoint = "handler.handler"
source_dir = "${path.module}/code/calc-python"
}
output "calc_python_url" {
description = "URL Python-калькулятора"
value = sless_service.calc_python.url
}
# ─── Node.js-калькулятор ─────────────────────────────────────────────────────
resource "sless_service" "calc_node" {
name = "calc-node"
runtime = "nodejs20"
entrypoint = "handler.handler"
source_dir = "${path.module}/code/calc-node"
}
output "calc_node_url" {
description = "URL Node.js-калькулятора"
value = sless_service.calc_node.url
}