pulumi/pkg
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
..
apitype various fixes to get build running on mac (#3454) 2019-11-06 11:11:38 -08:00
backend Add ability to opt-in to using yarn instead of npm (#3556) 2019-11-21 20:59:48 +00:00
codegen/python Creation of generator package (#2970) 2019-07-22 17:09:35 -07:00
diag Do not prefix failed operation errors. 2019-11-19 17:17:17 -08:00
encoding Add license headers 2018-05-22 15:02:47 -07:00
engine Propagate parent and providers for go SDK calls (#3563) 2019-11-26 13:23:34 -08:00
graph Improve `stack graph`. (#3431) 2019-10-31 17:39:15 -07:00
npm Add ability to opt-in to using yarn instead of npm (#3556) 2019-11-21 20:59:48 +00:00
operations Collect logs from Google Cloud Functions 2019-04-08 09:44:05 -07:00
resource Add ability to run policy plugins directly 2019-11-27 16:41:40 -08:00
secrets Cache account information. (#3340) 2019-10-15 15:37:57 -07:00
testing Retry failed update steps in integration tests. (#3542) 2019-11-20 12:52:57 -08:00
tokens Fix comment about QName regex (#3121) 2019-08-20 14:43:48 -07:00
tools Add a `WriteString` method to `tools/GenWriter`. (#1839) 2018-08-29 14:43:20 -07:00
util Add codefresh CI detection. Thanks to @fernandocarletti. (#3270) 2019-09-25 14:41:13 -07:00
version Add license headers 2018-05-22 15:02:47 -07:00
workspace Add ability to run policy plugins directly 2019-11-27 16:41:40 -08:00