great-sunset-355
02/26/2024, 12:12 PM@pulumi/command"
?
I am trying to run an extra TS code after the resource is deployed.
I have 2 questions:
1) How can pulumi watch the script file to trigger even when the script changes, does it have anything to do with assetPath
? https://www.pulumi.com/registry/packages/command/api-docs/local/command/#assetpaths_nodejs
2) Is there a better way to run this, perhaps in apply
?
Thank you
const cmd = new command.local.Command(
`myscript-${name}`,
{
environment: {
"ASSUME_ROLE_ARN": pulumi.interpolate`arn:aws:iam::${account.id}:role/${role}`
},
create: "node --require ts-node/register myScript.ts",
update: "node --require ts-node/register myScript.ts",
},
{ parent }
);
cmd.stdout.apply(console.log);