b77403b4bb
This change implements a `pulumi refresh` command. It operates a bit like `pulumi update`, and friends, in that it supports `--preview` and `--diff`, along with the usual flags, and will update your checkpoint. It works through substitution of the deploy.Source abstraction, which generates a sequence of resource registration events. This new deploy.RefreshSource takes in a prior checkpoint and will walk it, refreshing the state via the associated resource providers by invoking Read for each resource encountered, and merging the resulting state with the prior checkpoint, to yield a new resource.Goal state. This state is then fed through the engine in the usual ways with a few minor caveats: namely, although the engine must generate steps for the logical operations (permitting us to get nice summaries, progress, and diffs), it mustn't actually carry them out because the state being imported already reflects reality (a deleted resource has *already* been deleted, so of course the engine need not perform the deletion). The diffing logic also needs to know how to treat the case of refresh slightly differently, because we are going to be diffing outputs and not inputs. Note that support for managed stacks is not yet complete, since that requires updates to the service to support a refresh endpoint. That will be coming soon ... |
||
---|---|---|
.. | ||
destroy.go | ||
diff.go | ||
engine.go | ||
events.go | ||
eventsink.go | ||
plan.go | ||
preview.go | ||
project.go | ||
refresh.go | ||
update.go |