sless-primer/POSTGRES/functions.tf

37 lines
1.4 KiB
HCL
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# Создано: 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
}