pulumi/pkg
Will Jones 17b66dfc56
Add a `call` intrinsic to PCL
In order for PCL to serve as an authoritative intermediate language for
Pulumi programs, it needs to be able to express all the concepts
available to a Pulumi program written in a high-level programming
language. Put another way, it must be capable of expressing all the
functionality exposed by the `ResourceMonitor` interface. Presently, the
ability to `Call` methods on component resources is not available in
PCL. This change adds a new `call` intrinsic to fix that.

`call` has three required arguments: the receiver (that will become the
`__self__` argument under the hood), the method name (that must exist in
the resource's `Methods` map in schema), and an object of arguments
(whose specifications must appear in the corresponding `Function` in the
schema). An example use of `call` might thus look as follows:

```hcl
resource "c" "pkg:index:Callable" {
  ...
}

output "o" {
  value = call(c, "method", { x = 1, y = 2 })
}
```

In order to type check and applications of `call` when binding PCL
programs, we use the recently powered-up annotations feature to look up
the resource node of the receiver from its expression. With this, we are
able to grab the schema and validate the method name and arguments.
While we add unit tests for binding programs that use `call`, this
change does not extend program generation or the conformance test suite.
This will be done in a subsequent set of changes.

Part of fixing pulumi/pulumi-java#262
2025-01-10 16:58:48 +00:00
..
asset Move some asset code to pkg (#15162) 2024-01-17 11:30:37 +00:00
authhelpers Enable goheader rule and add missing license headers (#15473) 2024-09-09 12:05:45 +00:00
backend retry deletes in a bucket if they fail (#18059) 2024-12-18 09:38:13 +00:00
channel Move `sdk/go/common/channel` to `pkg` (#17895) 2024-12-02 16:25:50 +00:00
cmd/pulumi Adds support for Copilot templates to `pulumi new` (#16825) 2025-01-09 10:14:57 +00:00
codegen Add a `call` intrinsic to PCL 2025-01-10 16:58:48 +00:00
display Move sdk/go/common/display to /pkg/display (#13954) 2023-09-18 11:01:28 +00:00
engine Enable `pulumi:pulumi:getResource` to hydrate `Read` resources (#18070) 2024-12-22 20:13:43 +00:00
graph Support topologically sorting snapshots (#17403) 2024-10-01 08:45:35 +00:00
importer [cli/import] Fix undefined variable errors in code generation when imported resources use a parent or provider (#16786) 2024-07-25 13:53:44 +00:00
operations Move resource.URN to urn.URN (#15689) 2024-03-14 15:28:32 +00:00
resource Enable `pulumi:pulumi:getResource` to hydrate `Read` resources (#18070) 2024-12-22 20:13:43 +00:00
secrets Enable some more linting rules (#17456) 2024-10-03 17:37:13 +00:00
testing/integration Honor opts.PreviewCommandlineFlags in preview after refresh (#18063) 2024-12-17 19:04:27 +00:00
util Update golangci-lint (#17972) 2024-12-10 11:50:38 +00:00
workspace Implement plugin download cancellation (#17621) 2024-11-12 18:04:25 +00:00
README.md export codegen tests for internal use (#8928) 2022-02-07 12:10:04 +01:00
go.mod Changelog and go.mod updates for v3.145.0 (#18181) 2025-01-08 18:33:19 +00:00
go.sum Only use gRPC to communicate with the Java host (#18138) 2025-01-03 16:48:13 +00:00

README.md

pulumi/pkg

While pulumi/sdk maintains strict backwards compatibility guarantees, code under pkg/ is handled more informally: while breaking changes are still discouraged they may happen when they make sense.