Skip to content

stacks: add invoke_action_addrs plan option for direct action invocation - #38754

Draft
RonRicardo wants to merge 1 commit into
mainfrom
rr/v2-prototype-stacks-direct-invoke
Draft

stacks: add invoke_action_addrs plan option for direct action invocation#38754
RonRicardo wants to merge 1 commit into
mainfrom
rr/v2-prototype-stacks-direct-invoke

Conversation

@RonRicardo

@RonRicardo RonRicardo commented Jun 22, 2026

Copy link
Copy Markdown
Contributor

Description

Adds an invoke_action_addrs option 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 sets ActionTargets to the requested action addresses, so the run produces no resource changes — it only invokes the action (plan → apply gated).

What changed

  • proto (internal/rpcapi/terraform1/stacks): new invoke_action_addrs field (8) on the plan request.
  • rpcapi (internal/rpcapi/stacks.go): decode/validate action addresses; return InvalidArgument on a malformed address; thread them through PlanRequestPlanOpts.
  • stackeval (component_instance.go, planning.go): when invoke addresses are present, set ActionTargets and force RefreshOnlyMode.
  • Unit tests (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

  • If a change needs to be reverted, we will roll out an update to the code within 7 days.

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

  • This change is user-facing and I added a changelog entry.
  • This change is not user-facing.

Related PRs (Stacks Direct Invoke)


Draft / prototype. Part of a 3-PR set for Stacks Direct Invoke (terraform + tfc-agent + atlas).

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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant