33 lines
1.3 KiB
Terraform
33 lines
1.3 KiB
Terraform
# Создано: 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
|
|
}
|