I'm using the Pulumi Automation API in Go, and I want to format the standard output (stdout) as JSON. Currently, I handle stdout like this:
stdoutStreamer := optup.ProgressStreams(os.Stdout)
_, err = stack.Up(context.Background(), stdoutStreamer)
if err != nil {
log.Fatalf("Failed to update stack: %v\n\n", err)
}
Is there a simple and easy way to have the output formatted as JSON? Any suggestions or examples would be greatly appreciated. Thanks in advance
stack.Upas its second argument. You can easily adapt that example to output JSON-formatted data.pulumi up -joption in go automation API. pkg.go.dev/github.com/pulumi/pulumi/sdk/v3/go/auto/optup . Is there a workaround? Anyone?