This is a simple Pulumi provider that allows one to run arbitrary commands and treat their outputs as a resource. With this, anything can be done in a Pulumi program.
It is important to ensure that the output of a command is deterministic. If it is not, use the diff command to ensure the net results are deterministic. The output of the update and and create commands should remain the same (not just the command effects). See the examples for usage details.
See ./examples folder for examples of plugin usage for available runtimes.
Note:
python
andnodejs
runtimes will pull required plugin binaries automatically, fordotnet
andgo
runtimes check Installation instruction below
Find available versions on releases page and install prebuild plugin with this command:
pulumi plugin install resource command v<version> --server https://github.com/brandonkal/pulumi-command/releases/download/v<version>/
To build and install plugin from source you can do this:
- Checkout this repo
- Run this commands:
make provider
make install
Install the pulumictl
cli from the releases page or follow the install instructions
NB: Usage of
pulumictl
is optional. If not using it, hard code the version in the Makefile of when building explicitly pass version asVERSION=0.0.1 make build
# build and install the resource provider plugin
$ make build install
# test
$ cd examples/simple
$ npm install
$ pulumi stack init test
$ pulumi up
Thank you to Luke Hoban for his help answering my Pulumi questions on Slack.
© Brandon Kalinowski. Apache-2.0.