Startup hooks. Is it possible to define a callback...
# general
n
Startup hooks. Is it possible to define a callback for the Pulumi bootstrapping stage where I can check if Pulumi has been launched with the correct environment? I have several different clients using Pulumi in different execution environments and I forget who is who. eg
Copy code
function pulumiBootstrap() {
  const execCommand = process.argv.join(' ');

  if (process.env.AWS_VAULT !== "abc-profile") {
    throw new Error(`Run from: aws-vault exec abc-profile -- ${execCommand}`);
  }
}
e
Can't you just do that at the start of your pulumi program?
n
Yes I guess I could, good tip.
e
The perks of things just being code 🙂