From b198c74bb0a18aa055b48039b0aab99b5bbc8591 Mon Sep 17 00:00:00 2001 From: Agustin Celentano <12614595+agustincelentano@users.noreply.github.com> Date: Fri, 7 Aug 2026 11:30:33 -0300 Subject: [PATCH] feat(trigger): restrict the link to scopes The target function is derived from the bound scope, so a link created at application level arrives without tags.scope_id and has nothing to wire. Takes effect once the registering module forwards the field; service_definition does not yet (nullplatform/tofu-modules#477). --- README.md | 2 ++ dynamodb/specs/links/trigger.json.tpl | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 90bfc29..f844aa6 100644 --- a/README.md +++ b/README.md @@ -73,6 +73,8 @@ Delivery is at-least-once, so handlers must be idempotent. Functions that report The target function is resolved from the linked scope using the Lambda scope's naming convention. If that convention ever changes, the trigger fails with "function not found" rather than wiring something wrong. +Because the function name is derived from the scope, the link is only meaningful when bound to one: attached to the application, the context arrives without `tags.scope_id` and there is nothing to wire. The spec declares `assignable_to: scope` so the platform does not offer it at application level. Note that this only takes effect once the registering module forwards the field — `service_definition` currently does not. + ## Local testing Set `aws_profile` in `values.yaml`, run `aws sso login --profile `, and start the agent locally. The service falls back to those credentials when no IAM provider is configured. diff --git a/dynamodb/specs/links/trigger.json.tpl b/dynamodb/specs/links/trigger.json.tpl index 06eebe5..ef75d02 100644 --- a/dynamodb/specs/links/trigger.json.tpl +++ b/dynamodb/specs/links/trigger.json.tpl @@ -2,7 +2,7 @@ "name": "Trigger", "slug": "trigger", "unique": false, - "assignable_to": "any", + "assignable_to": "scope", "use_default_actions": true, "selectors": { "category": "Database",