Does `dependsOn` not respect the delete order? I ...
# general
g
Does
dependsOn
not respect the delete order? I attached a local command to the IAM user but removing the code and then
pulumi up
will attempt to delete
iamUser
before running the command. 🤷
Copy code
const userName = "myUser"
    const cleanupCmd = new command.local.Command(
      `delete-iam-user`,
      {
        environment: {
          IAM_USERNAME: userName,
        },
        delete: `date && node --require ts-node/register delete-iam-user.ts`,
        // triggers: [md5],
      },
    );
    // cleanupCmd.apply(console.log);
    const iamUser = new aws.iam.User(
      `user`,{name: userName},
      { dependsOn: cleanupCmd}
    );
this is with pulumi
3.112.0
a
to elaborate on what I said below - the Command is just a pulumi resource like any other, so the dependency means it will be created before the user and deleted after the user
leaving off the create property of the command means the creation is a no-op, but it doesn’t make pulumi understand or treat the command as a “cleanup” command
g
right, so I should swap the order and it should be alright
a
yep, I believe so
g
thanks! it was 3 am thinking