diff --git a/hello-node/http.tf b/hello-node/http.tf index ee255cd..e0678ca 100644 --- a/hello-node/http.tf +++ b/hello-node/http.tf @@ -30,6 +30,8 @@ resource "sless_trigger" "hello_http" { name = "hello-http-trigger" type = "http" function = sless_function.hello_http.name + # enabled = false — чтобы заморозить функцию (не удаляя ресурс), потом поставить зновь true + enabled = true } output "trigger_url" { diff --git a/hello-node/job.tf b/hello-node/job.tf index 23097dc..8687f77 100644 --- a/hello-node/job.tf +++ b/hello-node/job.tf @@ -28,12 +28,14 @@ resource "sless_function" "hello_job" { } # Одноразовый запуск. Все поля immutable — изменение любого пересоздаёт джоб. +# run_id: 0 = не запускать, 1+ = запустить. Для повторного запуска увеличь run_id (1→2→3...). resource "sless_job" "hello_run" { namespace = "default" name = "hello-run" function = sless_function.hello_job.name event_json = jsonencode({ numbers = [1, 2, 3, 4, 5] }) wait_timeout_sec = 120 + run_id = 1 } output "job_phase" { diff --git a/hello-node/main.tf b/hello-node/main.tf index 0bd5b5c..6e11712 100644 --- a/hello-node/main.tf +++ b/hello-node/main.tf @@ -8,7 +8,7 @@ terraform { required_providers { sless = { source = "terra.k8c.ru/naeel/sless" - version = "~> 0.1.1" + version = "~> 0.1.4" } archive = { source = "hashicorp/archive"