https://pulumi.com logo
#general
Title
# general
a

aloof-baker-86174

02/11/2024, 5:41 PM
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

billions-xylophone-85957

02/11/2024, 5:52 PM
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

aloof-baker-86174

02/11/2024, 5:54 PM
That makes sense. I wasn't really thinking of it like a normal resource. Thank you!
e

echoing-dinner-19531

02/12/2024, 8:40 AM
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

aloof-baker-86174

02/12/2024, 3:52 PM
nifty!