Add a --json flag to the preview command
This change adds a --json flag to the preview command, enabling basic JSON serialization of preview plans. This effectively flattens the engine event stream into a preview structure that contains a list of steps, diagnostics, and summary information. Each step contains the deep serialization of resource state, in addition to metadata about the step, such as what kind of operation it entails. This is a partial implementation of pulumi/pulumi#2390. In particular, we only support --json on the `preview` command itself, and not `up`, meaning that it isn't possible to serialize the result of an actual deployment yet (thereby limiting what you can do with outputs, etc).
This commit is contained in:
parent
23f905a468
commit
234c3dfec9
|
@ -478,10 +478,11 @@ func (b *localBackend) apply(
|
|||
}
|
||||
}
|
||||
|
||||
fmt.Printf(
|
||||
_, err := fmt.Fprintf(os.Stderr,
|
||||
op.Opts.Display.Color.Colorize(
|
||||
colors.SpecHeadline+"Permalink: "+
|
||||
colors.Underline+colors.BrightBlue+"%s"+colors.Reset+"\n"), link)
|
||||
contract.IgnoreError(err)
|
||||
}
|
||||
|
||||
return changes, nil
|
||||
|
|
Loading…
Reference in a new issue