37 lines
1.4 KiB
HCL
37 lines
1.4 KiB
HCL
# Создано: 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"
|
||
memory_mb = 128
|
||
timeout_sec = 30
|
||
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"
|
||
memory_mb = 128
|
||
timeout_sec = 30
|
||
source_dir = "${path.module}/code/calc-node"
|
||
}
|
||
|
||
output "calc_node_url" {
|
||
description = "URL Node.js-калькулятора"
|
||
value = sless_service.calc_node.url
|
||
}
|