25 lines
633 B
HCL
25 lines
633 B
HCL
# 2026-03-08 / Изменено: 2026-03-09
|
|
# http.tf — HTTP-функция: принимает запросы, возвращает приветствие.
|
|
# Код: code/handler-http.js
|
|
|
|
resource "sless_function" "hello_http" {
|
|
name = "hello-http"
|
|
runtime = "nodejs20"
|
|
entrypoint = "handler-http.handle"
|
|
memory_mb = 128
|
|
timeout_sec = 30
|
|
|
|
source_dir = "${path.module}/code"
|
|
}
|
|
|
|
resource "sless_trigger" "hello_http" {
|
|
name = "hello-http-trigger"
|
|
type = "http"
|
|
function = sless_function.hello_http.name
|
|
enabled = true
|
|
}
|
|
|
|
output "trigger_url" {
|
|
value = sless_trigger.hello_http.url
|
|
}
|