https://pulumi.com logo
#typescript
Title
# typescript
w

wet-soccer-72485

10/23/2020, 9:13 PM
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

hundreds-musician-51496

10/24/2020, 4:21 AM
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

wet-soccer-72485

10/24/2020, 6:22 PM
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