stacks: add invoke_action_addrs plan option for direct action invocation - #38754
Draft
RonRicardo wants to merge 1 commit into
Draft
stacks: add invoke_action_addrs plan option for direct action invocation#38754RonRicardo wants to merge 1 commit into
RonRicardo wants to merge 1 commit into
Conversation
Adds a new repeated string invoke_action_addrs field (proto field 8) to PlanStackChanges.Request, parsed in the RPC handler (InvalidArgument on a bad address) and threaded through PlanRequest and stackeval.PlanOpts. ComponentInstance.PlanOpts now collects any invoke addresses that target the instance, sets them as ActionTargets, and forces RefreshOnlyMode so only the action is planned while all other resource changes are suppressed. This reuses the existing Core action-targeting engine without touching context_plan.go or any apply-side graph code. Includes a stackruntime plan test (direct-invoke-action fixture) and an rpcapi test covering the InvalidArgument path, plus a changelog entry.
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.
Description
Adds an
invoke_action_addrsoption to the stacks plan RPC so a caller can request a direct action invocation against an already-deployed stack deployment. When the option is set, Core plans only the targeted action(s): the component instance forces refresh-only planning and setsActionTargetsto the requested action addresses, so the run produces no resource changes — it only invokes the action (plan → apply gated).What changed
internal/rpcapi/terraform1/stacks): newinvoke_action_addrsfield (8) on the plan request.internal/rpcapi/stacks.go): decode/validate action addresses; returnInvalidArgumenton a malformed address; thread them throughPlanRequest→PlanOpts.component_instance.go,planning.go): when invoke addresses are present, setActionTargetsand forceRefreshOnlyMode.stacks_test.go,plan_test.go), a testdata fixture, and a changelog entry.Why
Core piece of the Stacks Direct Invoke prototype — invoke a pre-defined action on a deployed stack deployment without a full config-driven plan/apply. The tfc-agent and atlas changes that drive this RPC are in sibling PRs.
Relates to: https://hashicorp.atlassian.net/browse/TF-38426
Target Release
1.16.x
Rollback Plan
Changes to Security Controls
No changes to security controls (access controls, encryption, logging). The new option only narrows planning to the targeted action addresses and forces refresh-only mode; malformed input is rejected with
InvalidArgument.CHANGELOG entry
Related PRs (Stacks Direct Invoke)