PCL invokes multi-argument functions positionally
Introduced 2026-07-08 · score 0.97
HOW TO USE IT
When invoking a function declared with `multiArgumentInputs`, pass one positional argument per input; put optional `invokeOptions` last. Use `null` for an omitted optional input when supplying options.
invoke("pkg:index:fn", <arg1>, <arg2>)invoke("pkg:index:fn", <arg1>, null, { provider = <provider> })WHY THIS HELPS
When writing PCL that invokes a function declared with `multiArgumentInputs`, pass each input positionally and place optional invoke options last.
BEFORE THIS CHANGE
The release note states that these functions previously took a single object argument, such as `invoke("pkg:index:fn", { p1 = arg1, p2 = arg2 })`; this form is now rejected for functions declared with `multiArgumentInputs`.
REQUIREMENTS AND LIMITATIONS
- Version: v3.251.0
- function token (required): String token identifying the provider function.
- positional input arguments (required): Pass one argument for each declared input, in declaration order. Optional inputs can be `null`; requiredness and types depend on that function’s schema.
- invokeOptions: Optional final object after all input positions. Documented keys: `provider`, `parent`, `version`, `pluginDownloadUrl`, `dependsOn`. The source does not state that these keys are mutually exclusive.
- Prerequisite: Use Pulumi v3.251.0 or later for this PCL behavior.
- This positional invocation behavior applies to functions declared with `multiArgumentInputs`.
- The optional `invokeOptions` object follows one positional argument per input.
- Use `null` for an omitted optional input when supplying options.
- Calls with more than one argument per input plus the options object are rejected.
- PCL and program generators continue to observe the normalized object form.
FIRST-PARTY EVIDENCE
- https://github.com/pulumi/pulumi/releases/tag/v3.251.0
- https://github.com/pulumi/pulumi/pull/23571
- https://github.com/pulumi/pulumi/blob/v3.251.0/pkg/codegen/pcl/invoke_positional.go
- https://github.com/pulumi/pulumi/blob/v3.251.0/pkg/codegen/pcl/invoke.go
Check the installed version and the source before using it. Entry JSON