Skip to content

Commit

Permalink
tfjson: Add DeferredChanges and Complete to Plan JSON (#123)
Browse files Browse the repository at this point in the history
* initial deferred response support

* add `complete` flag
  • Loading branch information
austinvalle authored May 2, 2024
1 parent 8cba21a commit 3b8a921
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions plan.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,14 @@ type Plan struct {
// plan.
ResourceChanges []*ResourceChange `json:"resource_changes,omitempty"`

// DeferredChanges contains the change operations for resources that are deferred
// for this plan.
DeferredChanges []*DeferredResourceChange `json:"deferred_changes,omitempty"`

// Complete indicates that all resources have successfully planned changes.
// This will be false if there are DeferredChanges or if the -target flag is used.
Complete bool `json:"complete,omitempty"`

// The change operations for outputs within this plan.
OutputChanges map[string]*Change `json:"output_changes,omitempty"`

Expand Down Expand Up @@ -269,3 +277,13 @@ type PlanVariable struct {
// The value for this variable at plan time.
Value interface{} `json:"value,omitempty"`
}

// DeferredResourceChange is a description of a resource change that has been
// deferred for some reason.
type DeferredResourceChange struct {
// Reason is the reason why this resource change was deferred.
Reason string `json:"reason,omitempty"`

// Change contains any information we have about the deferred change.
ResourceChange *ResourceChange `json:"resource_change,omitempty"`
}

0 comments on commit 3b8a921

Please sign in to comment.