From d99985720f65fd8ae12a1edf89657a9385ef308b Mon Sep 17 00:00:00 2001 From: Martin Atkins Date: Tue, 26 Sep 2023 16:19:22 -0700 Subject: [PATCH] stacks: Carry input variable values from plan to apply We need to preserve the input variable values provided during the plan phase so we can reuse them during the apply phase to recalculate derived results based on new information learned during the apply process. We also need to recalculate the input values for individual components during the apply phase, so we can react to previously-unknown values that come from other upstream components. --- internal/stacks/stackplan/from_proto.go | 15 +- internal/stacks/stackplan/plan.go | 7 + internal/stacks/stackplan/planned_change.go | 59 ++++ .../internal/stackeval/component_instance.go | 53 +++- .../internal/stackeval/input_variable.go | 21 +- .../stackruntime/internal/stackeval/main.go | 39 ++- .../internal/stackeval/main_apply.go | 2 +- .../stacks/tfstackdata1/tfstackdata1.pb.go | 278 ++++++++++++------ .../stacks/tfstackdata1/tfstackdata1.proto | 17 ++ 9 files changed, 392 insertions(+), 99 deletions(-) diff --git a/internal/stacks/stackplan/from_proto.go b/internal/stacks/stackplan/from_proto.go index 95d3b48e0a..0603293f75 100644 --- a/internal/stacks/stackplan/from_proto.go +++ b/internal/stacks/stackplan/from_proto.go @@ -10,13 +10,15 @@ import ( "github.com/hashicorp/terraform/internal/stacks/stackaddrs" "github.com/hashicorp/terraform/internal/stacks/tfstackdata1" "github.com/hashicorp/terraform/version" + "github.com/zclconf/go-cty/cty" "google.golang.org/protobuf/proto" "google.golang.org/protobuf/types/known/anypb" ) func LoadFromProto(msgs []*anypb.Any) (*Plan, error) { ret := &Plan{ - Components: collections.NewMap[stackaddrs.AbsComponentInstance, *Component](), + RootInputValues: make(map[stackaddrs.InputVariable]cty.Value), + Components: collections.NewMap[stackaddrs.AbsComponentInstance, *Component](), } foundHeader := false @@ -45,6 +47,17 @@ func LoadFromProto(msgs []*anypb.Any) (*Plan, error) { case *tfstackdata1.PlanApplyable: ret.Applyable = msg.Applyable + case *tfstackdata1.PlanRootInputValue: + addr := stackaddrs.InputVariable{ + Name: msg.Name, + } + dv := plans.DynamicValue(msg.Value.Msgpack) + val, err := dv.Decode(cty.DynamicPseudoType) + if err != nil { + return nil, fmt.Errorf("invalid stored value for %s: %w", addr, err) + } + ret.RootInputValues[addr] = val + case *tfstackdata1.PlanComponentInstance: addr, diags := stackaddrs.ParseAbsComponentInstanceStr(msg.ComponentInstanceAddr) if diags.HasErrors() { diff --git a/internal/stacks/stackplan/plan.go b/internal/stacks/stackplan/plan.go index c151fc54f0..318bf41a9e 100644 --- a/internal/stacks/stackplan/plan.go +++ b/internal/stacks/stackplan/plan.go @@ -1,6 +1,8 @@ package stackplan import ( + "github.com/zclconf/go-cty/cty" + "github.com/hashicorp/terraform/internal/collections" "github.com/hashicorp/terraform/internal/stacks/stackaddrs" ) @@ -22,6 +24,11 @@ type Plan struct { // the planning process did not entirely run. Applyable bool + // RootInputValues are the input variable values provided to calculate + // the plan. We must use the same values during the apply step to + // sure that the actions taken can be consistent with what was planned. + RootInputValues map[stackaddrs.InputVariable]cty.Value + // Components contains the separate plans for each of the compoonent // instances defined in the overall stack configuration, including any // nested component instances from embedded stacks. diff --git a/internal/stacks/stackplan/planned_change.go b/internal/stacks/stackplan/planned_change.go index 4ff59045c7..5997dc266a 100644 --- a/internal/stacks/stackplan/planned_change.go +++ b/internal/stacks/stackplan/planned_change.go @@ -12,6 +12,7 @@ import ( "github.com/hashicorp/terraform/internal/addrs" "github.com/hashicorp/terraform/internal/plans" "github.com/hashicorp/terraform/internal/plans/planfile" + "github.com/hashicorp/terraform/internal/plans/planproto" "github.com/hashicorp/terraform/internal/rpcapi/terraform1" "github.com/hashicorp/terraform/internal/stacks/stackaddrs" "github.com/hashicorp/terraform/internal/stacks/tfstackdata1" @@ -35,6 +36,45 @@ type PlannedChange interface { PlannedChangeProto() (*terraform1.PlannedChange, error) } +// PlannedChangeRootInputValue announces the existence of a root stack input +// variable and captures its plan-time value so we can make sure to use +// the same value during the apply phase. +type PlannedChangeRootInputValue struct { + Addr stackaddrs.InputVariable + + // Value is the value we used for the variable during planning. + Value cty.Value +} + +var _ PlannedChange = (*PlannedChangeRootInputValue)(nil) + +// PlannedChangeProto implements PlannedChange. +func (pc *PlannedChangeRootInputValue) PlannedChangeProto() (*terraform1.PlannedChange, error) { + // We use cty.DynamicPseudoType here so that we'll save both the + // value _and_ its dynamic type in the plan, so we can recover + // exactly the same value later. + dv, err := plans.NewDynamicValue(pc.Value, cty.DynamicPseudoType) + if err != nil { + return nil, fmt.Errorf("can't encode value for %s: %w", pc.Addr, err) + } + + var raw anypb.Any + err = anypb.MarshalFrom(&raw, &tfstackdata1.PlanRootInputValue{ + Name: pc.Addr.Name, + Value: &planproto.DynamicValue{ + Msgpack: dv, + }, + }, proto.MarshalOptions{}) + if err != nil { + return nil, err + } + return &terraform1.PlannedChange{ + Raw: []*anypb.Any{&raw}, + + // There is no external-facing description for this change type. + }, nil +} + // PlannedChangeComponentInstance announces the existence of a component // instance and describes (using a plan action) whether it is being added // or removed. @@ -50,6 +90,14 @@ type PlannedChangeComponentInstance struct { // are tracked in their own [PlannedChange] objects. Action plans.Action + // PlannedInputValues records our best approximation of the component's + // topmost input values during the planning phase. This could contain + // unknown values if one component is configured from results of another. + // This therefore won't be used directly as the input values during apply, + // but the final set of input values during apply should be consistent + // with what's captured here. + PlannedInputValues map[string]plans.DynamicValue + // PlanTimestamp is the timestamp that would be returned from the // "plantimestamp" function in modules inside this component. We // must preserve this in the raw plan data to ensure that we can @@ -61,10 +109,21 @@ var _ PlannedChange = (*PlannedChangeComponentInstance)(nil) // PlannedChangeProto implements PlannedChange. func (pc *PlannedChangeComponentInstance) PlannedChangeProto() (*terraform1.PlannedChange, error) { + var plannedInputValues map[string]*planproto.DynamicValue + if n := len(pc.PlannedInputValues); n != 0 { + plannedInputValues = make(map[string]*planproto.DynamicValue, n) + for k, v := range pc.PlannedInputValues { + plannedInputValues[k] = &planproto.DynamicValue{ + Msgpack: v, + } + } + } + var raw anypb.Any err := anypb.MarshalFrom(&raw, &tfstackdata1.PlanComponentInstance{ ComponentInstanceAddr: pc.Addr.String(), PlanTimestamp: pc.PlanTimestamp.Format(time.RFC3339), + PlannedInputValues: plannedInputValues, // We don't track the action as part of the raw data because we // don't actually need it to apply the change; it's only included // for external consumption, such as rendering changes in the UI. diff --git a/internal/stacks/stackruntime/internal/stackeval/component_instance.go b/internal/stacks/stackruntime/internal/stackeval/component_instance.go index aab1149778..6e7268d6a0 100644 --- a/internal/stacks/stackruntime/internal/stackeval/component_instance.go +++ b/internal/stacks/stackruntime/internal/stackeval/component_instance.go @@ -655,6 +655,54 @@ func (c *ComponentInstance) ApplyModuleTreePlan(ctx context.Context, plan *plans return nil, diags } + // We'll need to make some light modifications to the plan to include + // information we've learned in other parts of the apply walk that + // should've filled in some unknown value placeholders. It would be rude + // to modify the plan that our caller is holding though, so we'll + // shallow-copy it. This is NOT a deep copy, so don't modify anything + // that's reachable through any pointers without copying those first too. + modifiedPlan := *plan + inputValues := c.inputValuesForModulesRuntime(ctx, ApplyPhase) + if inputValues == nil { + // inputValuesForModulesRuntime uses nil (as opposed to a + // non-nil zerolen map) to represent that the definition of + // the input variables was so invalid that we cannot do + // anything with it, in which case we'll just return early + // and assume the plan walk driver will find the diagnostics + // via another return path. + return nil, diags + } + // TODO: Check that the final input values are consistent with what + // we had during planning. If not, that suggests a bug elsewhere. + // + // UGH: the "modules runtime"'s model of planning was designed around + // the goal of producing a traditional Terraform CLI-style saved plan + // file and so it has the input variable values already encoded as + // plans.DynamicValue opaque byte arrays, and so we need to convert + // our resolved input values into that format. It would be better + // if plans.Plan used the typical in-memory format for input values + // and let the plan file serializer worry about encoding, but we'll + // defer that API change for now to avoid disrupting other codepaths. + modifiedPlan.VariableValues = make(map[string]plans.DynamicValue, len(inputValues)) + for name, iv := range inputValues { + dv, err := plans.NewDynamicValue(iv.Value, cty.DynamicPseudoType) + if err != nil { + diags = diags.Append(tfdiags.Sourceless( + tfdiags.Error, + "Failed to encode input variable value", + fmt.Sprintf( + "Could not encode the value of input variable %q of %s: %s.\n\nThis is a bug in Terraform; please report it!", + name, c.Addr(), err, + ), + )) + continue + } + modifiedPlan.VariableValues[name] = dv + } + if diags.HasErrors() { + return nil, diags + } + providerClients, valid := c.neededProviderClients(ctx, PlanPhase) if !valid { diags = diags.Append(&hcl.Diagnostic{ @@ -666,7 +714,7 @@ func (c *ComponentInstance) ApplyModuleTreePlan(ctx context.Context, plan *plans return nil, diags } - newState, moreDiags := tfCtx.Apply(plan, moduleTree, &terraform.ApplyOpts{ + newState, moreDiags := tfCtx.Apply(&modifiedPlan, moduleTree, &terraform.ApplyOpts{ ExternalProviders: providerClients, }) diags = diags.Append(moreDiags) @@ -797,7 +845,8 @@ func (c *ComponentInstance) PlanChanges(ctx context.Context) ([]stackplan.Planne // FIXME: Once we actually have a prior state this should vary // depending on whether the same component instance existed in // the prior state. - Action: plans.Create, + Action: plans.Create, + PlannedInputValues: corePlan.VariableValues, // We must remember the plan timestamp so that the plantimestamp // function can return a consistent result during a later apply phase. diff --git a/internal/stacks/stackruntime/internal/stackeval/input_variable.go b/internal/stacks/stackruntime/internal/stackeval/input_variable.go index 56b19872be..1294a00a24 100644 --- a/internal/stacks/stackruntime/internal/stackeval/input_variable.go +++ b/internal/stacks/stackruntime/internal/stackeval/input_variable.go @@ -165,7 +165,26 @@ func (v *InputVariable) checkValid(ctx context.Context, phase EvalPhase) tfdiags // PlanChanges implements Plannable as a plan-time validation of the variable's // declaration and of the caller's definition of the variable. func (v *InputVariable) PlanChanges(ctx context.Context) ([]stackplan.PlannedChange, tfdiags.Diagnostics) { - return nil, v.checkValid(ctx, PlanPhase) + diags := v.checkValid(ctx, PlanPhase) + if diags.HasErrors() { + return nil, diags + } + + // Only the root stack's input values can contribute directly to the plan. + // Embedded stack inputs will be recalculated during the apply phase + // because the values might be derived from component outputs that aren't + // known yet during planning. + if !v.Addr().Stack.IsRoot() { + return nil, diags + } + + val := v.Value(ctx, PlanPhase) + return []stackplan.PlannedChange{ + &stackplan.PlannedChangeRootInputValue{ + Addr: v.Addr().Item, + Value: val, + }, + }, diags } // CheckApply implements ApplyChecker. diff --git a/internal/stacks/stackruntime/internal/stackeval/main.go b/internal/stacks/stackruntime/internal/stackeval/main.go index f43fa3f8c8..32cf7444cd 100644 --- a/internal/stacks/stackruntime/internal/stackeval/main.go +++ b/internal/stacks/stackruntime/internal/stackeval/main.go @@ -64,8 +64,9 @@ type mainPlanning struct { } type mainApplying struct { - opts ApplyOpts - results *ChangeExecResults + opts ApplyOpts + rootInputVals map[stackaddrs.InputVariable]cty.Value + results *ChangeExecResults } func NewForValidating(config *stackconfig.Config, opts ValidateOpts) *Main { @@ -93,12 +94,13 @@ func NewForPlanning(config *stackconfig.Config, opts PlanOpts) *Main { } } -func NewForApplying(config *stackconfig.Config, execResults *ChangeExecResults, opts ApplyOpts) *Main { +func NewForApplying(config *stackconfig.Config, rootInputs map[stackaddrs.InputVariable]cty.Value, execResults *ChangeExecResults, opts ApplyOpts) *Main { return &Main{ config: config, applying: &mainApplying{ - opts: opts, - results: execResults, + opts: opts, + rootInputVals: rootInputs, + results: execResults, }, providerFactories: opts.ProviderFactories, providerTypes: make(map[addrs.Provider]*ProviderType), @@ -313,8 +315,8 @@ func (m *Main) ProviderInstance(ctx context.Context, addr stackaddrs.AbsProvider func (m *Main) RootVariableValue(ctx context.Context, addr stackaddrs.InputVariable, phase EvalPhase) ExternalInputValue { switch phase { case PlanPhase: - if m.planning == nil { - panic("using plan-phase input variable values when not configured for planning") + if !m.Planning() { + panic("using PlanPhase input variable values when not configured for planning") } ret, ok := m.planning.opts.InputVariableValues[addr] if !ok { @@ -324,8 +326,27 @@ func (m *Main) RootVariableValue(ctx context.Context, addr stackaddrs.InputVaria } return ret - // TODO: Also ApplyPhase, which should return values that were recorded - // in the plan. + case ApplyPhase: + if !m.Applying() { + panic("using ApplyPhase input variable values when not configured for applying") + } + ret, ok := m.applying.rootInputVals[addr] + if !ok { + // We should not get here if the given plan was created from the + // given configuration, since we should always record a value + // for every declared root input variable in the plan. + return ExternalInputValue{ + Value: cty.DynamicVal, + } + } + return ExternalInputValue{ + Value: ret, + + // We don't save source location information for variable + // definitions in the plan, but that's okay because if we were + // going to report any errors for these values then we should've + // already done it during the plan phase, and so couldn't get here.. + } default: // Root input variable values are not available in any other phase. diff --git a/internal/stacks/stackruntime/internal/stackeval/main_apply.go b/internal/stacks/stackruntime/internal/stackeval/main_apply.go index ced20dbe1c..e5aa8c9fd2 100644 --- a/internal/stacks/stackruntime/internal/stackeval/main_apply.go +++ b/internal/stacks/stackruntime/internal/stackeval/main_apply.go @@ -109,7 +109,7 @@ func ApplyPlan(ctx context.Context, config *stackconfig.Config, rawPlan []*anypb } }) - main := NewForApplying(config, results, opts) + main := NewForApplying(config, plan.RootInputValues, results, opts) begin(ctx, main) // the change tasks registered above become runnable // With the planned changes now in progress, we'll visit everything and diff --git a/internal/stacks/tfstackdata1/tfstackdata1.pb.go b/internal/stacks/tfstackdata1/tfstackdata1.pb.go index 17710b85c6..c5f2f5d6e5 100644 --- a/internal/stacks/tfstackdata1/tfstackdata1.pb.go +++ b/internal/stacks/tfstackdata1/tfstackdata1.pb.go @@ -136,6 +136,65 @@ func (x *PlanApplyable) GetApplyable() bool { return false } +// Records the value of one of the main stack's input values during planning. +// +// These values get fixed during the plan phase so that we can ensure that we +// use identical values when subsequently applying the plan. +type PlanRootInputValue struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` + Value *planproto.DynamicValue `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"` +} + +func (x *PlanRootInputValue) Reset() { + *x = PlanRootInputValue{} + if protoimpl.UnsafeEnabled { + mi := &file_tfstackdata1_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *PlanRootInputValue) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*PlanRootInputValue) ProtoMessage() {} + +func (x *PlanRootInputValue) ProtoReflect() protoreflect.Message { + mi := &file_tfstackdata1_proto_msgTypes[2] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use PlanRootInputValue.ProtoReflect.Descriptor instead. +func (*PlanRootInputValue) Descriptor() ([]byte, []int) { + return file_tfstackdata1_proto_rawDescGZIP(), []int{2} +} + +func (x *PlanRootInputValue) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +func (x *PlanRootInputValue) GetValue() *planproto.DynamicValue { + if x != nil { + return x.Value + } + return nil +} + // Represents the existence of a particular component instance, and so must // always appear before any messages representing objects that belong to that // component instance. @@ -154,12 +213,19 @@ type PlanComponentInstance struct { // "plantimestamp" function can return the same value during the apply // phase. It must not be used for any other purpose. PlanTimestamp string `protobuf:"bytes,2,opt,name=plan_timestamp,json=planTimestamp,proto3" json:"plan_timestamp,omitempty"` + // Captures an approximation of the input values for this component with + // as much detail as we knew during the planning phase. This might + // contain unknown values as placeholders for values that won't be + // determined until the apply phase, so this isn't usable directly as + // the input to subsequently applying the component plan but the final + // input values should be a valid concretization of what's described here. + PlannedInputValues map[string]*planproto.DynamicValue `protobuf:"bytes,3,rep,name=planned_input_values,json=plannedInputValues,proto3" json:"planned_input_values,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` } func (x *PlanComponentInstance) Reset() { *x = PlanComponentInstance{} if protoimpl.UnsafeEnabled { - mi := &file_tfstackdata1_proto_msgTypes[2] + mi := &file_tfstackdata1_proto_msgTypes[3] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -172,7 +238,7 @@ func (x *PlanComponentInstance) String() string { func (*PlanComponentInstance) ProtoMessage() {} func (x *PlanComponentInstance) ProtoReflect() protoreflect.Message { - mi := &file_tfstackdata1_proto_msgTypes[2] + mi := &file_tfstackdata1_proto_msgTypes[3] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -185,7 +251,7 @@ func (x *PlanComponentInstance) ProtoReflect() protoreflect.Message { // Deprecated: Use PlanComponentInstance.ProtoReflect.Descriptor instead. func (*PlanComponentInstance) Descriptor() ([]byte, []int) { - return file_tfstackdata1_proto_rawDescGZIP(), []int{2} + return file_tfstackdata1_proto_rawDescGZIP(), []int{3} } func (x *PlanComponentInstance) GetComponentInstanceAddr() string { @@ -202,6 +268,13 @@ func (x *PlanComponentInstance) GetPlanTimestamp() string { return "" } +func (x *PlanComponentInstance) GetPlannedInputValues() map[string]*planproto.DynamicValue { + if x != nil { + return x.PlannedInputValues + } + return nil +} + // Represents a planned change to a particular resource instance within a // particular component instance. type PlanResourceInstanceChangePlanned struct { @@ -218,7 +291,7 @@ type PlanResourceInstanceChangePlanned struct { func (x *PlanResourceInstanceChangePlanned) Reset() { *x = PlanResourceInstanceChangePlanned{} if protoimpl.UnsafeEnabled { - mi := &file_tfstackdata1_proto_msgTypes[3] + mi := &file_tfstackdata1_proto_msgTypes[4] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -231,7 +304,7 @@ func (x *PlanResourceInstanceChangePlanned) String() string { func (*PlanResourceInstanceChangePlanned) ProtoMessage() {} func (x *PlanResourceInstanceChangePlanned) ProtoReflect() protoreflect.Message { - mi := &file_tfstackdata1_proto_msgTypes[3] + mi := &file_tfstackdata1_proto_msgTypes[4] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -244,7 +317,7 @@ func (x *PlanResourceInstanceChangePlanned) ProtoReflect() protoreflect.Message // Deprecated: Use PlanResourceInstanceChangePlanned.ProtoReflect.Descriptor instead. func (*PlanResourceInstanceChangePlanned) Descriptor() ([]byte, []int) { - return file_tfstackdata1_proto_rawDescGZIP(), []int{3} + return file_tfstackdata1_proto_rawDescGZIP(), []int{4} } func (x *PlanResourceInstanceChangePlanned) GetComponentInstanceAddr() string { @@ -278,7 +351,7 @@ type PlanResourceInstanceChangeOutside struct { func (x *PlanResourceInstanceChangeOutside) Reset() { *x = PlanResourceInstanceChangeOutside{} if protoimpl.UnsafeEnabled { - mi := &file_tfstackdata1_proto_msgTypes[4] + mi := &file_tfstackdata1_proto_msgTypes[5] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -291,7 +364,7 @@ func (x *PlanResourceInstanceChangeOutside) String() string { func (*PlanResourceInstanceChangeOutside) ProtoMessage() {} func (x *PlanResourceInstanceChangeOutside) ProtoReflect() protoreflect.Message { - mi := &file_tfstackdata1_proto_msgTypes[4] + mi := &file_tfstackdata1_proto_msgTypes[5] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -304,7 +377,7 @@ func (x *PlanResourceInstanceChangeOutside) ProtoReflect() protoreflect.Message // Deprecated: Use PlanResourceInstanceChangeOutside.ProtoReflect.Descriptor instead. func (*PlanResourceInstanceChangeOutside) Descriptor() ([]byte, []int) { - return file_tfstackdata1_proto_rawDescGZIP(), []int{4} + return file_tfstackdata1_proto_rawDescGZIP(), []int{5} } func (x *PlanResourceInstanceChangeOutside) GetComponentInstanceAddr() string { @@ -344,7 +417,7 @@ type StateComponentInstanceV1 struct { func (x *StateComponentInstanceV1) Reset() { *x = StateComponentInstanceV1{} if protoimpl.UnsafeEnabled { - mi := &file_tfstackdata1_proto_msgTypes[5] + mi := &file_tfstackdata1_proto_msgTypes[6] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -357,7 +430,7 @@ func (x *StateComponentInstanceV1) String() string { func (*StateComponentInstanceV1) ProtoMessage() {} func (x *StateComponentInstanceV1) ProtoReflect() protoreflect.Message { - mi := &file_tfstackdata1_proto_msgTypes[5] + mi := &file_tfstackdata1_proto_msgTypes[6] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -370,7 +443,7 @@ func (x *StateComponentInstanceV1) ProtoReflect() protoreflect.Message { // Deprecated: Use StateComponentInstanceV1.ProtoReflect.Descriptor instead. func (*StateComponentInstanceV1) Descriptor() ([]byte, []int) { - return file_tfstackdata1_proto_rawDescGZIP(), []int{5} + return file_tfstackdata1_proto_rawDescGZIP(), []int{6} } func (x *StateComponentInstanceV1) GetComponentInstanceAddr() string { @@ -403,7 +476,7 @@ type StateResourceInstanceV1 struct { func (x *StateResourceInstanceV1) Reset() { *x = StateResourceInstanceV1{} if protoimpl.UnsafeEnabled { - mi := &file_tfstackdata1_proto_msgTypes[6] + mi := &file_tfstackdata1_proto_msgTypes[7] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -416,7 +489,7 @@ func (x *StateResourceInstanceV1) String() string { func (*StateResourceInstanceV1) ProtoMessage() {} func (x *StateResourceInstanceV1) ProtoReflect() protoreflect.Message { - mi := &file_tfstackdata1_proto_msgTypes[6] + mi := &file_tfstackdata1_proto_msgTypes[7] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -429,7 +502,7 @@ func (x *StateResourceInstanceV1) ProtoReflect() protoreflect.Message { // Deprecated: Use StateResourceInstanceV1.ProtoReflect.Descriptor instead. func (*StateResourceInstanceV1) Descriptor() ([]byte, []int) { - return file_tfstackdata1_proto_rawDescGZIP(), []int{6} + return file_tfstackdata1_proto_rawDescGZIP(), []int{7} } func (x *StateResourceInstanceV1) GetComponentInstanceAddr() string { @@ -479,56 +552,74 @@ var file_tfstackdata1_proto_rawDesc = []byte{ 0x72, 0x61, 0x66, 0x6f, 0x72, 0x6d, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x22, 0x2d, 0x0a, 0x0d, 0x50, 0x6c, 0x61, 0x6e, 0x41, 0x70, 0x70, 0x6c, 0x79, 0x61, 0x62, 0x6c, 0x65, 0x12, 0x1c, 0x0a, 0x09, 0x61, 0x70, 0x70, 0x6c, 0x79, 0x61, 0x62, 0x6c, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x08, 0x52, 0x09, 0x61, 0x70, 0x70, 0x6c, 0x79, 0x61, 0x62, 0x6c, 0x65, 0x22, 0x76, 0x0a, 0x15, - 0x50, 0x6c, 0x61, 0x6e, 0x43, 0x6f, 0x6d, 0x70, 0x6f, 0x6e, 0x65, 0x6e, 0x74, 0x49, 0x6e, 0x73, - 0x74, 0x61, 0x6e, 0x63, 0x65, 0x12, 0x36, 0x0a, 0x17, 0x63, 0x6f, 0x6d, 0x70, 0x6f, 0x6e, 0x65, - 0x6e, 0x74, 0x5f, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x5f, 0x61, 0x64, 0x64, 0x72, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x15, 0x63, 0x6f, 0x6d, 0x70, 0x6f, 0x6e, 0x65, 0x6e, - 0x74, 0x49, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x41, 0x64, 0x64, 0x72, 0x12, 0x25, 0x0a, - 0x0e, 0x70, 0x6c, 0x61, 0x6e, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x18, - 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x70, 0x6c, 0x61, 0x6e, 0x54, 0x69, 0x6d, 0x65, 0x73, - 0x74, 0x61, 0x6d, 0x70, 0x22, 0x93, 0x01, 0x0a, 0x21, 0x50, 0x6c, 0x61, 0x6e, 0x52, 0x65, 0x73, - 0x6f, 0x75, 0x72, 0x63, 0x65, 0x49, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x43, 0x68, 0x61, - 0x6e, 0x67, 0x65, 0x50, 0x6c, 0x61, 0x6e, 0x6e, 0x65, 0x64, 0x12, 0x36, 0x0a, 0x17, 0x63, 0x6f, - 0x6d, 0x70, 0x6f, 0x6e, 0x65, 0x6e, 0x74, 0x5f, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, - 0x5f, 0x61, 0x64, 0x64, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x15, 0x63, 0x6f, 0x6d, - 0x70, 0x6f, 0x6e, 0x65, 0x6e, 0x74, 0x49, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x41, 0x64, - 0x64, 0x72, 0x12, 0x36, 0x0a, 0x06, 0x63, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x18, 0x02, 0x20, 0x01, - 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x74, 0x66, 0x70, 0x6c, 0x61, 0x6e, 0x2e, 0x52, 0x65, 0x73, 0x6f, - 0x75, 0x72, 0x63, 0x65, 0x49, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x43, 0x68, 0x61, 0x6e, - 0x67, 0x65, 0x52, 0x06, 0x63, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x22, 0x93, 0x01, 0x0a, 0x21, 0x50, - 0x6c, 0x61, 0x6e, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x49, 0x6e, 0x73, 0x74, 0x61, - 0x6e, 0x63, 0x65, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x4f, 0x75, 0x74, 0x73, 0x69, 0x64, 0x65, - 0x12, 0x36, 0x0a, 0x17, 0x63, 0x6f, 0x6d, 0x70, 0x6f, 0x6e, 0x65, 0x6e, 0x74, 0x5f, 0x69, 0x6e, - 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x15, 0x63, 0x6f, 0x6d, 0x70, 0x6f, 0x6e, 0x65, 0x6e, 0x74, 0x49, 0x6e, 0x73, 0x74, - 0x61, 0x6e, 0x63, 0x65, 0x41, 0x64, 0x64, 0x72, 0x12, 0x36, 0x0a, 0x06, 0x63, 0x68, 0x61, 0x6e, - 0x67, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x74, 0x66, 0x70, 0x6c, 0x61, - 0x6e, 0x2e, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x49, 0x6e, 0x73, 0x74, 0x61, 0x6e, - 0x63, 0x65, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x52, 0x06, 0x63, 0x68, 0x61, 0x6e, 0x67, 0x65, - 0x22, 0x52, 0x0a, 0x18, 0x53, 0x74, 0x61, 0x74, 0x65, 0x43, 0x6f, 0x6d, 0x70, 0x6f, 0x6e, 0x65, - 0x6e, 0x74, 0x49, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x56, 0x31, 0x12, 0x36, 0x0a, 0x17, + 0x08, 0x52, 0x09, 0x61, 0x70, 0x70, 0x6c, 0x79, 0x61, 0x62, 0x6c, 0x65, 0x22, 0x54, 0x0a, 0x12, + 0x50, 0x6c, 0x61, 0x6e, 0x52, 0x6f, 0x6f, 0x74, 0x49, 0x6e, 0x70, 0x75, 0x74, 0x56, 0x61, 0x6c, + 0x75, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x2a, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x74, 0x66, 0x70, 0x6c, 0x61, 0x6e, 0x2e, 0x44, + 0x79, 0x6e, 0x61, 0x6d, 0x69, 0x63, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x05, 0x76, 0x61, 0x6c, + 0x75, 0x65, 0x22, 0xc2, 0x02, 0x0a, 0x15, 0x50, 0x6c, 0x61, 0x6e, 0x43, 0x6f, 0x6d, 0x70, 0x6f, + 0x6e, 0x65, 0x6e, 0x74, 0x49, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x12, 0x36, 0x0a, 0x17, 0x63, 0x6f, 0x6d, 0x70, 0x6f, 0x6e, 0x65, 0x6e, 0x74, 0x5f, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x15, 0x63, 0x6f, 0x6d, 0x70, 0x6f, 0x6e, 0x65, 0x6e, 0x74, 0x49, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, - 0x41, 0x64, 0x64, 0x72, 0x22, 0x8b, 0x02, 0x0a, 0x17, 0x53, 0x74, 0x61, 0x74, 0x65, 0x52, 0x65, - 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x49, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x56, 0x31, - 0x12, 0x36, 0x0a, 0x17, 0x63, 0x6f, 0x6d, 0x70, 0x6f, 0x6e, 0x65, 0x6e, 0x74, 0x5f, 0x69, 0x6e, - 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x15, 0x63, 0x6f, 0x6d, 0x70, 0x6f, 0x6e, 0x65, 0x6e, 0x74, 0x49, 0x6e, 0x73, 0x74, - 0x61, 0x6e, 0x63, 0x65, 0x41, 0x64, 0x64, 0x72, 0x12, 0x34, 0x0a, 0x16, 0x72, 0x65, 0x73, 0x6f, - 0x75, 0x72, 0x63, 0x65, 0x5f, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x5f, 0x61, 0x64, - 0x64, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x14, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, - 0x63, 0x65, 0x49, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x41, 0x64, 0x64, 0x72, 0x12, 0x1f, - 0x0a, 0x0b, 0x64, 0x65, 0x70, 0x6f, 0x73, 0x65, 0x64, 0x5f, 0x6b, 0x65, 0x79, 0x18, 0x03, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x0a, 0x64, 0x65, 0x70, 0x6f, 0x73, 0x65, 0x64, 0x4b, 0x65, 0x79, 0x12, - 0x2a, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x14, - 0x2e, 0x74, 0x66, 0x70, 0x6c, 0x61, 0x6e, 0x2e, 0x44, 0x79, 0x6e, 0x61, 0x6d, 0x69, 0x63, 0x56, - 0x61, 0x6c, 0x75, 0x65, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x35, 0x0a, 0x0f, 0x73, - 0x65, 0x6e, 0x73, 0x69, 0x74, 0x69, 0x76, 0x65, 0x5f, 0x70, 0x61, 0x74, 0x68, 0x73, 0x18, 0x05, - 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0c, 0x2e, 0x74, 0x66, 0x70, 0x6c, 0x61, 0x6e, 0x2e, 0x50, 0x61, - 0x74, 0x68, 0x52, 0x0e, 0x73, 0x65, 0x6e, 0x73, 0x69, 0x74, 0x69, 0x76, 0x65, 0x50, 0x61, 0x74, - 0x68, 0x73, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x41, 0x64, 0x64, 0x72, 0x12, 0x25, 0x0a, 0x0e, 0x70, 0x6c, 0x61, 0x6e, 0x5f, 0x74, 0x69, 0x6d, + 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x70, 0x6c, + 0x61, 0x6e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x12, 0x6d, 0x0a, 0x14, 0x70, + 0x6c, 0x61, 0x6e, 0x6e, 0x65, 0x64, 0x5f, 0x69, 0x6e, 0x70, 0x75, 0x74, 0x5f, 0x76, 0x61, 0x6c, + 0x75, 0x65, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x3b, 0x2e, 0x74, 0x66, 0x73, 0x74, + 0x61, 0x63, 0x6b, 0x64, 0x61, 0x74, 0x61, 0x31, 0x2e, 0x50, 0x6c, 0x61, 0x6e, 0x43, 0x6f, 0x6d, + 0x70, 0x6f, 0x6e, 0x65, 0x6e, 0x74, 0x49, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x2e, 0x50, + 0x6c, 0x61, 0x6e, 0x6e, 0x65, 0x64, 0x49, 0x6e, 0x70, 0x75, 0x74, 0x56, 0x61, 0x6c, 0x75, 0x65, + 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x12, 0x70, 0x6c, 0x61, 0x6e, 0x6e, 0x65, 0x64, 0x49, + 0x6e, 0x70, 0x75, 0x74, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x1a, 0x5b, 0x0a, 0x17, 0x50, 0x6c, + 0x61, 0x6e, 0x6e, 0x65, 0x64, 0x49, 0x6e, 0x70, 0x75, 0x74, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x73, + 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x2a, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x74, 0x66, 0x70, 0x6c, 0x61, 0x6e, 0x2e, + 0x44, 0x79, 0x6e, 0x61, 0x6d, 0x69, 0x63, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x05, 0x76, 0x61, + 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x22, 0x93, 0x01, 0x0a, 0x21, 0x50, 0x6c, 0x61, 0x6e, + 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x49, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, + 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x50, 0x6c, 0x61, 0x6e, 0x6e, 0x65, 0x64, 0x12, 0x36, 0x0a, + 0x17, 0x63, 0x6f, 0x6d, 0x70, 0x6f, 0x6e, 0x65, 0x6e, 0x74, 0x5f, 0x69, 0x6e, 0x73, 0x74, 0x61, + 0x6e, 0x63, 0x65, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x15, + 0x63, 0x6f, 0x6d, 0x70, 0x6f, 0x6e, 0x65, 0x6e, 0x74, 0x49, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, + 0x65, 0x41, 0x64, 0x64, 0x72, 0x12, 0x36, 0x0a, 0x06, 0x63, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x74, 0x66, 0x70, 0x6c, 0x61, 0x6e, 0x2e, 0x52, + 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x49, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x43, + 0x68, 0x61, 0x6e, 0x67, 0x65, 0x52, 0x06, 0x63, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x22, 0x93, 0x01, + 0x0a, 0x21, 0x50, 0x6c, 0x61, 0x6e, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x49, 0x6e, + 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x4f, 0x75, 0x74, 0x73, + 0x69, 0x64, 0x65, 0x12, 0x36, 0x0a, 0x17, 0x63, 0x6f, 0x6d, 0x70, 0x6f, 0x6e, 0x65, 0x6e, 0x74, + 0x5f, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x15, 0x63, 0x6f, 0x6d, 0x70, 0x6f, 0x6e, 0x65, 0x6e, 0x74, 0x49, + 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x41, 0x64, 0x64, 0x72, 0x12, 0x36, 0x0a, 0x06, 0x63, + 0x68, 0x61, 0x6e, 0x67, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x74, 0x66, + 0x70, 0x6c, 0x61, 0x6e, 0x2e, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x49, 0x6e, 0x73, + 0x74, 0x61, 0x6e, 0x63, 0x65, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x52, 0x06, 0x63, 0x68, 0x61, + 0x6e, 0x67, 0x65, 0x22, 0x52, 0x0a, 0x18, 0x53, 0x74, 0x61, 0x74, 0x65, 0x43, 0x6f, 0x6d, 0x70, + 0x6f, 0x6e, 0x65, 0x6e, 0x74, 0x49, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x56, 0x31, 0x12, + 0x36, 0x0a, 0x17, 0x63, 0x6f, 0x6d, 0x70, 0x6f, 0x6e, 0x65, 0x6e, 0x74, 0x5f, 0x69, 0x6e, 0x73, + 0x74, 0x61, 0x6e, 0x63, 0x65, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x15, 0x63, 0x6f, 0x6d, 0x70, 0x6f, 0x6e, 0x65, 0x6e, 0x74, 0x49, 0x6e, 0x73, 0x74, 0x61, + 0x6e, 0x63, 0x65, 0x41, 0x64, 0x64, 0x72, 0x22, 0x8b, 0x02, 0x0a, 0x17, 0x53, 0x74, 0x61, 0x74, + 0x65, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x49, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, + 0x65, 0x56, 0x31, 0x12, 0x36, 0x0a, 0x17, 0x63, 0x6f, 0x6d, 0x70, 0x6f, 0x6e, 0x65, 0x6e, 0x74, + 0x5f, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x15, 0x63, 0x6f, 0x6d, 0x70, 0x6f, 0x6e, 0x65, 0x6e, 0x74, 0x49, + 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x41, 0x64, 0x64, 0x72, 0x12, 0x34, 0x0a, 0x16, 0x72, + 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x5f, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, + 0x5f, 0x61, 0x64, 0x64, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x14, 0x72, 0x65, 0x73, + 0x6f, 0x75, 0x72, 0x63, 0x65, 0x49, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x41, 0x64, 0x64, + 0x72, 0x12, 0x1f, 0x0a, 0x0b, 0x64, 0x65, 0x70, 0x6f, 0x73, 0x65, 0x64, 0x5f, 0x6b, 0x65, 0x79, + 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x64, 0x65, 0x70, 0x6f, 0x73, 0x65, 0x64, 0x4b, + 0x65, 0x79, 0x12, 0x2a, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x14, 0x2e, 0x74, 0x66, 0x70, 0x6c, 0x61, 0x6e, 0x2e, 0x44, 0x79, 0x6e, 0x61, 0x6d, + 0x69, 0x63, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x35, + 0x0a, 0x0f, 0x73, 0x65, 0x6e, 0x73, 0x69, 0x74, 0x69, 0x76, 0x65, 0x5f, 0x70, 0x61, 0x74, 0x68, + 0x73, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0c, 0x2e, 0x74, 0x66, 0x70, 0x6c, 0x61, 0x6e, + 0x2e, 0x50, 0x61, 0x74, 0x68, 0x52, 0x0e, 0x73, 0x65, 0x6e, 0x73, 0x69, 0x74, 0x69, 0x76, 0x65, + 0x50, 0x61, 0x74, 0x68, 0x73, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -543,29 +634,34 @@ func file_tfstackdata1_proto_rawDescGZIP() []byte { return file_tfstackdata1_proto_rawDescData } -var file_tfstackdata1_proto_msgTypes = make([]protoimpl.MessageInfo, 7) +var file_tfstackdata1_proto_msgTypes = make([]protoimpl.MessageInfo, 9) var file_tfstackdata1_proto_goTypes = []interface{}{ (*PlanHeader)(nil), // 0: tfstackdata1.PlanHeader (*PlanApplyable)(nil), // 1: tfstackdata1.PlanApplyable - (*PlanComponentInstance)(nil), // 2: tfstackdata1.PlanComponentInstance - (*PlanResourceInstanceChangePlanned)(nil), // 3: tfstackdata1.PlanResourceInstanceChangePlanned - (*PlanResourceInstanceChangeOutside)(nil), // 4: tfstackdata1.PlanResourceInstanceChangeOutside - (*StateComponentInstanceV1)(nil), // 5: tfstackdata1.StateComponentInstanceV1 - (*StateResourceInstanceV1)(nil), // 6: tfstackdata1.StateResourceInstanceV1 - (*planproto.ResourceInstanceChange)(nil), // 7: tfplan.ResourceInstanceChange - (*planproto.DynamicValue)(nil), // 8: tfplan.DynamicValue - (*planproto.Path)(nil), // 9: tfplan.Path + (*PlanRootInputValue)(nil), // 2: tfstackdata1.PlanRootInputValue + (*PlanComponentInstance)(nil), // 3: tfstackdata1.PlanComponentInstance + (*PlanResourceInstanceChangePlanned)(nil), // 4: tfstackdata1.PlanResourceInstanceChangePlanned + (*PlanResourceInstanceChangeOutside)(nil), // 5: tfstackdata1.PlanResourceInstanceChangeOutside + (*StateComponentInstanceV1)(nil), // 6: tfstackdata1.StateComponentInstanceV1 + (*StateResourceInstanceV1)(nil), // 7: tfstackdata1.StateResourceInstanceV1 + nil, // 8: tfstackdata1.PlanComponentInstance.PlannedInputValuesEntry + (*planproto.DynamicValue)(nil), // 9: tfplan.DynamicValue + (*planproto.ResourceInstanceChange)(nil), // 10: tfplan.ResourceInstanceChange + (*planproto.Path)(nil), // 11: tfplan.Path } var file_tfstackdata1_proto_depIdxs = []int32{ - 7, // 0: tfstackdata1.PlanResourceInstanceChangePlanned.change:type_name -> tfplan.ResourceInstanceChange - 7, // 1: tfstackdata1.PlanResourceInstanceChangeOutside.change:type_name -> tfplan.ResourceInstanceChange - 8, // 2: tfstackdata1.StateResourceInstanceV1.value:type_name -> tfplan.DynamicValue - 9, // 3: tfstackdata1.StateResourceInstanceV1.sensitive_paths:type_name -> tfplan.Path - 4, // [4:4] is the sub-list for method output_type - 4, // [4:4] is the sub-list for method input_type - 4, // [4:4] is the sub-list for extension type_name - 4, // [4:4] is the sub-list for extension extendee - 0, // [0:4] is the sub-list for field type_name + 9, // 0: tfstackdata1.PlanRootInputValue.value:type_name -> tfplan.DynamicValue + 8, // 1: tfstackdata1.PlanComponentInstance.planned_input_values:type_name -> tfstackdata1.PlanComponentInstance.PlannedInputValuesEntry + 10, // 2: tfstackdata1.PlanResourceInstanceChangePlanned.change:type_name -> tfplan.ResourceInstanceChange + 10, // 3: tfstackdata1.PlanResourceInstanceChangeOutside.change:type_name -> tfplan.ResourceInstanceChange + 9, // 4: tfstackdata1.StateResourceInstanceV1.value:type_name -> tfplan.DynamicValue + 11, // 5: tfstackdata1.StateResourceInstanceV1.sensitive_paths:type_name -> tfplan.Path + 9, // 6: tfstackdata1.PlanComponentInstance.PlannedInputValuesEntry.value:type_name -> tfplan.DynamicValue + 7, // [7:7] is the sub-list for method output_type + 7, // [7:7] is the sub-list for method input_type + 7, // [7:7] is the sub-list for extension type_name + 7, // [7:7] is the sub-list for extension extendee + 0, // [0:7] is the sub-list for field type_name } func init() { file_tfstackdata1_proto_init() } @@ -599,7 +695,7 @@ func file_tfstackdata1_proto_init() { } } file_tfstackdata1_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*PlanComponentInstance); i { + switch v := v.(*PlanRootInputValue); i { case 0: return &v.state case 1: @@ -611,7 +707,7 @@ func file_tfstackdata1_proto_init() { } } file_tfstackdata1_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*PlanResourceInstanceChangePlanned); i { + switch v := v.(*PlanComponentInstance); i { case 0: return &v.state case 1: @@ -623,7 +719,7 @@ func file_tfstackdata1_proto_init() { } } file_tfstackdata1_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*PlanResourceInstanceChangeOutside); i { + switch v := v.(*PlanResourceInstanceChangePlanned); i { case 0: return &v.state case 1: @@ -635,7 +731,7 @@ func file_tfstackdata1_proto_init() { } } file_tfstackdata1_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*StateComponentInstanceV1); i { + switch v := v.(*PlanResourceInstanceChangeOutside); i { case 0: return &v.state case 1: @@ -647,6 +743,18 @@ func file_tfstackdata1_proto_init() { } } file_tfstackdata1_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*StateComponentInstanceV1); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_tfstackdata1_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*StateResourceInstanceV1); i { case 0: return &v.state @@ -665,7 +773,7 @@ func file_tfstackdata1_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_tfstackdata1_proto_rawDesc, NumEnums: 0, - NumMessages: 7, + NumMessages: 9, NumExtensions: 0, NumServices: 0, }, diff --git a/internal/stacks/tfstackdata1/tfstackdata1.proto b/internal/stacks/tfstackdata1/tfstackdata1.proto index 0e21b2f1c3..7e81c017b2 100644 --- a/internal/stacks/tfstackdata1/tfstackdata1.proto +++ b/internal/stacks/tfstackdata1/tfstackdata1.proto @@ -56,6 +56,15 @@ message PlanApplyable { bool applyable = 1; } +// Records the value of one of the main stack's input values during planning. +// +// These values get fixed during the plan phase so that we can ensure that we +// use identical values when subsequently applying the plan. +message PlanRootInputValue { + string name = 1; + tfplan.DynamicValue value = 2; +} + // Represents the existence of a particular component instance, and so must // always appear before any messages representing objects that belong to that // component instance. @@ -71,6 +80,14 @@ message PlanComponentInstance { // "plantimestamp" function can return the same value during the apply // phase. It must not be used for any other purpose. string plan_timestamp = 2; + + // Captures an approximation of the input values for this component with + // as much detail as we knew during the planning phase. This might + // contain unknown values as placeholders for values that won't be + // determined until the apply phase, so this isn't usable directly as + // the input to subsequently applying the component plan but the final + // input values should be a valid concretization of what's described here. + map planned_input_values = 3; } // Represents a planned change to a particular resource instance within a