mirror of
https://github.com/opentofu/opentofu.git
synced 2025-01-11 00:22:32 -06:00
fix each and count usage in import for sensitive values (#1530)
Signed-off-by: ollevche <ollevche@gmail.com>
This commit is contained in:
parent
846fd267fd
commit
f36def0a45
@ -560,7 +560,21 @@ func (n *NodePlannableResourceInstance) importState(ctx EvalContext, addr addrs.
|
||||
|
||||
// Insert marks from configuration
|
||||
if n.Config != nil {
|
||||
valueWithConfigurationSchemaMarks, _, configDiags := ctx.EvaluateBlock(n.Config.Config, n.Schema, nil, EvalDataForNoInstanceKey)
|
||||
keyData := EvalDataForNoInstanceKey
|
||||
|
||||
switch {
|
||||
case n.Config.Count != nil:
|
||||
keyData = InstanceKeyEvalData{
|
||||
CountIndex: cty.UnknownVal(cty.Number),
|
||||
}
|
||||
case n.Config.ForEach != nil:
|
||||
keyData = InstanceKeyEvalData{
|
||||
EachKey: cty.UnknownVal(cty.String),
|
||||
EachValue: cty.UnknownVal(cty.DynamicPseudoType),
|
||||
}
|
||||
}
|
||||
|
||||
valueWithConfigurationSchemaMarks, _, configDiags := ctx.EvaluateBlock(n.Config.Config, n.Schema, nil, keyData)
|
||||
diags = diags.Append(configDiags)
|
||||
if configDiags.HasErrors() {
|
||||
return instanceRefreshState, diags
|
||||
|
Loading…
Reference in New Issue
Block a user