feat(lambda): declare the scope's available actions in its spec - #35
Merged
Conversation
The list of actions a scope offers lived in the scope_definition module as a hardcoded default, far from the scope that implements them. That distance is what let them drift: the default listed "kill-instances" while the containers scope ships "kill-instance", and the mismatched name resolved to a 404 whose body reached jq as "404: Not Found" — a parse error that said nothing about a missing file. Declaring them here puts the list next to the action templates it names, so adding or renaming an action is one change in one repository. The fourteen match the action templates in specs/actions and the specifications currently registered for this scope. Requires the module to read the field: nullplatform/tofu-modules#458.
Merged
4 tasks
gdrojas
approved these changes
Aug 3, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Declares the actions this scope offers inside its own spec, so the
scope_definitionmodule can read them instead of carrying a hardcoded default.Why
The list lived in the module, far from the scope that implements the actions, and
that distance let the two drift. The default listed
kill-instanceswhile thecontainers scope ships
kill-instance.json.tpl; the module built a URL from thewrong name, got a 404, and the body
404: Not Foundreached jq as if it were thetemplate:
An error that says nothing about a missing file. With the list next to the
templates it names, adding or renaming an action is one change in one place.
What it adds
Fourteen actions, matching both the templates in
lambda/specs/actions/and thespecifications currently registered for this scope:
Verified that the rendered spec parses as JSON and that every name has its
.json.tpl.Merge order
Needs
nullplatform/tofu-modules#458, which makes the module read this field.Until that merges this changes nothing, and it is harmless on its own.
Worth noting the reverse is not true: that PR removes the module's default, so a
scope whose spec does not declare
available_actionsends up with an empty list —and an empty list in a
for_eachdestroys every action specification. This scopehad fourteen at risk.
🤖 Generated with Claude Code