# 2025-06-05 # notes-list.tf — функция для получения всех записей из таблицы notes. # GET или POST /fn/default/notes-list → JSON массив всех записей, сортировка по дате (новые первые). data "archive_file" "notes_list" { type = "zip" source_dir = "${path.module}/code/notes-list" output_path = "${path.module}/dist/notes-list.zip" } resource "sless_function" "notes_list" { namespace = "default" name = "notes-list" runtime = "python3.11" entrypoint = "handler.handle" memory_mb = 128 timeout_sec = 30 env_vars = { PG_DSN = var.pg_dsn } code_path = data.archive_file.notes_list.output_path code_hash = filesha256("${path.module}/code/notes-list/handler.py") } resource "sless_trigger" "notes_list_http" { namespace = "default" name = "notes-list-http" type = "http" function = sless_function.notes_list.name }