pulumi/pkg/workspace
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
..
creds.go Cache account information. (#3340) 2019-10-15 15:37:57 -07:00
paths.go Support lists and maps in config (#3342) 2019-11-01 13:41:27 -07:00
plugins.go Make the path to .pulumi folder configurable with an ENV variable (#3300) 2019-10-08 15:01:46 -07:00
plugins_test.go Look for exact match when loading plugins (#2483) 2019-03-01 15:42:38 -08:00
project.go Use PulumiPolicy.yaml instead of Pulumi.yaml for PolicyPacks 2019-10-10 10:15:51 -07:00
project_test.go Allow more types for runtimeOptions 2018-08-06 14:00:58 -07:00
settings.go Tidy up some data structures (#2135) 2018-11-01 08:28:11 -07:00
templates.go Add ability to run policy plugins directly 2019-11-27 16:41:40 -08:00
templates_test.go add `pulumi policy new` (#3423) 2019-10-30 11:00:44 -07:00
workspace.go Make the path to .pulumi folder configurable with an ENV variable (#3300) 2019-10-08 15:01:46 -07:00