From aa6b5af6a6ac7e9429cdd1c5d94bdadaa37e9494 Mon Sep 17 00:00:00 2001 From: Austin Valle Date: Fri, 26 Apr 2024 14:22:56 -0400 Subject: [PATCH 1/2] initial deferred response support --- plan.go | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/plan.go b/plan.go index 38ea778..51a047c 100644 --- a/plan.go +++ b/plan.go @@ -60,6 +60,10 @@ 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"` + // The change operations for outputs within this plan. OutputChanges map[string]*Change `json:"output_changes,omitempty"` @@ -269,3 +273,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"` +} From 46496e3e3fd02fa688fbf4f0b8ca530999a5f4bf Mon Sep 17 00:00:00 2001 From: Austin Valle Date: Thu, 2 May 2024 15:36:15 -0400 Subject: [PATCH 2/2] add `complete` flag --- plan.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/plan.go b/plan.go index 51a047c..67a5b6e 100644 --- a/plan.go +++ b/plan.go @@ -64,6 +64,10 @@ type Plan struct { // 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"`