pulumi/pkg/resource/plugin
joeduffy 8b9645e79e Add ability to run policy plugins directly
The current policy plugin system assumes that the target plugin
uses our opinionated Node.js loader shim to set up the plugin. This
makes it impossible to leverage plugins written in other languages
(like [Python](pulumi/pulumi-policy#98) or, in my case, Go).

It turns out this shim isn't entirely required. It's actually just
there for convenience, as it hides the boilerplate of implementing
the gRPC analyzer server necessary to communicate with the engine.
If you've implemented said interface by hand, or via some alternative
mechanism, there's no reason we can't just load the plugin like we
do with other plugins -- languages, resource providers, etc.

This change is arguably a bit of a hack. It looks at the target
--policy-pack and, if it's a directory, keeps the old behavior of
using the Node.js shim. If it's a file, on the other hand, it assumes
that file is the plugin binary and loads it directly. I'm not actually
suggesting this is the right way to do it. But it does unblock the
project I'm currently tinkering with.

This also calls into question what approach we'd actually want to
take with service-managed policy packs.

Either way, we will need to figure out what approach to take that
supports authoring policy packs in different languages.
2019-11-27 16:41:40 -08:00
..
analyzer.go Send resource URN and name to analyzer (#3554) 2019-11-21 21:01:15 +00:00
analyzer_plugin.go Add ability to run policy plugins directly 2019-11-27 16:41:40 -08:00
check.go Add license headers 2018-05-22 15:02:47 -07:00
config_source.go Add license headers 2018-05-22 15:02:47 -07:00
context.go Remove uses of plugins in the snapshot (#2662) 2019-04-23 09:53:44 -07:00
host.go Implement `--policy-pack` flag on `up` and `preview` 2019-08-12 12:45:48 -07:00
host_server.go Improve tracing support. (#3238) 2019-09-16 14:16:43 -07:00
langruntime.go Add nodejs support for query mode 2019-05-02 18:08:08 -07:00
langruntime_plugin.go Enable policies to run for all languages (#3524) 2019-11-18 18:29:12 +00:00
plugin.go Provide a more helpful PaC error (#3525) 2019-11-19 18:47:47 +00:00
provider.go Implement `StreamInvoke` 2019-11-05 10:47:48 -08:00
provider_plugin.go Enable policies to run for all languages (#3524) 2019-11-18 18:29:12 +00:00
provider_plugin_test.go Fix up some spelling errors 2019-06-18 15:30:25 -07:00
rpc.go Introduce MarshalOptions.{RejectAsset, RejectArchive} 2019-08-26 15:19:14 -07:00
rpc_test.go Introduce MarshalOptions.{RejectAsset, RejectArchive} 2019-08-26 15:19:14 -07:00