Does anyone know if it’s possible to log a message...
# typescript
w
Does anyone know if it’s possible to log a message / execute some code if a resource is being updated? Something like:
Copy code
const k8sCluster = new gcp.container.Cluster();
  k8sCluster.on('update', () => {
      pulumi.log.warn(
        `NOTE: It takes upwards of 35 minutes to update the Cluster. The current timeout for updates and deletes is hardcoded and the supplied create timeout is "${clusterTimeout}"`,
        this.k8sCluster
      );
    });
h
The automation API lets you run a preview and inspect the results. Pretty fresh code tho. https://www.pulumi.com/docs/reference/pkg/nodejs/pulumi/pulumi/x/automation/#Stack-preview
w
How do i import this?
Copy code
import { InlineProgramArgs, LocalWorkspace } from "@pulumi/pulumi/x/automation";
This seems to add an extra step of needing to automate a preview.
I think what I’d need access to is the current state of the runtime