From 8cef62e45593d553e249685b3199100ffc0748f8 Mon Sep 17 00:00:00 2001 From: James Bardin Date: Fri, 4 Sep 2020 16:49:19 -0400 Subject: [PATCH] add state to plans.Plan Since the refreshed state is now an artifact of the plan process, it makes sense to add it to the Plan type, rather than adding an additional return value to the Context.Plan method. --- plans/plan.go | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/plans/plan.go b/plans/plan.go index 5a3e4548e..92778e1e7 100644 --- a/plans/plan.go +++ b/plans/plan.go @@ -5,6 +5,7 @@ import ( "github.com/hashicorp/terraform/addrs" "github.com/hashicorp/terraform/configs/configschema" + "github.com/hashicorp/terraform/states" "github.com/zclconf/go-cty/cty" ) @@ -16,15 +17,16 @@ import ( // result that will be completed during apply by resolving any values that // cannot be predicted. // -// A plan must always be accompanied by the state and configuration it was -// built from, since the plan does not itself include all of the information -// required to make the changes indicated. +// A plan must always be accompanied by the configuration it was built from, +// since the plan does not itself include all of the information required to +// make the changes indicated. type Plan struct { VariableValues map[string]DynamicValue Changes *Changes TargetAddrs []addrs.Targetable ProviderSHA256s map[string][]byte Backend Backend + State *states.State } // Backend represents the backend-related configuration and other data as it