35 lines
1.9 KiB
Terraform
35 lines
1.9 KiB
Terraform
# ──────────────────────────────────────────────────────────────────────────────
|
||
# simple_functions.tf — примеры fission_simple_function (добавлено 2026-04-20)
|
||
#
|
||
# Демонстрирует использование нового составного ресурса, который заменяет
|
||
# отдельные fission_environment + fission_package + fission_function + fission_http_trigger
|
||
# одним блоком.
|
||
#
|
||
# Environment simple-<runtime>-env создаётся автоматически при первом apply.
|
||
# ──────────────────────────────────────────────────────────────────────────────
|
||
|
||
# ─── health-check (nodejs, с HTTPTrigger) ────────────────────────────────────
|
||
resource "fission_simple_function" "health" {
|
||
name = "ecom-health"
|
||
runtime = "nodejs"
|
||
code_dir = "${path.module}/code/node-health"
|
||
url = "/ecom/health"
|
||
methods = ["GET"]
|
||
}
|
||
|
||
# ─── metrics (python, без HTTPTrigger) ───────────────────────────────────────
|
||
resource "fission_simple_function" "metrics" {
|
||
name = "ecom-metrics"
|
||
runtime = "python"
|
||
code_dir = "${path.module}/code/python-metrics"
|
||
}
|
||
|
||
# ─── go-processor (go, с HTTPTrigger, PUT/POST) ───────────────────────────────
|
||
resource "fission_simple_function" "processor" {
|
||
name = "ecom-processor"
|
||
runtime = "go"
|
||
code_dir = "${path.module}/code/go-processor"
|
||
url = "/ecom/process"
|
||
methods = ["POST", "PUT"]
|
||
}
|