Howdy! I'm running the latest pulumi in Javascrip...
# general
a
Howdy! I'm running the latest pulumi in Javascript. Most of Pulumi is working great, but I'm trying local.Command for the first time and the problem is that it seems to only ever run if I change the command. Subsequent runs of
pulumi up
don't trigger this function to run unless I change
createLambdaAfterFileUploadZip
to something else like
foo
. Other than that this function works great.
Copy code
const createLambdaAfterFileUploadZip = new local.Command('createLambdaAfterFileUploadZip', {
        create: './create.nodemods.layer.sh',
        dir: './aws/lambda/layer/nodemods',
        assetPaths: ['./aws/lambda/layer/nodemods/nodemods.zip'],
    });
Any ideas what I might be doing wrong?
b
by default the command would be not re-executed after the successful creation. Think of the Command as a resource - once created, the update will only be executed if the inputs change. If you want to run the command on every update even if the inputs don't change, pass something like Date.now() to https://www.pulumi.com/registry/packages/command/api-docs/local/command/#triggers_nodejs
a
That makes sense. I wasn't really thinking of it like a normal resource. Thank you!
e
There's an invoke version of command as well https://www.pulumi.com/registry/packages/command/api-docs/local/run/ that runs every time
a
nifty!