mirror of
https://github.com/opentffoundation/opentf.git
synced 2025-12-25 01:00:16 -05:00
Import ForEach: Prerequisite - Prepare codebase for dynamic addresses for ImportTargets (#1207)
Signed-off-by: RLRabinowitz <rlrabinowitz2@gmail.com>
This commit is contained in:
@@ -14,8 +14,6 @@ import (
|
||||
|
||||
"github.com/hashicorp/hcl/v2"
|
||||
"github.com/hashicorp/hcl/v2/hclsyntax"
|
||||
"github.com/zclconf/go-cty/cty"
|
||||
|
||||
"github.com/opentofu/opentofu/internal/addrs"
|
||||
"github.com/opentofu/opentofu/internal/backend"
|
||||
"github.com/opentofu/opentofu/internal/command/arguments"
|
||||
@@ -238,11 +236,10 @@ func (c *ImportCommand) Run(args []string) int {
|
||||
newState, importDiags := lr.Core.Import(lr.Config, lr.InputState, &tofu.ImportOpts{
|
||||
Targets: []*tofu.ImportTarget{
|
||||
{
|
||||
Addr: addr,
|
||||
|
||||
// In the import block, the ID can be an arbitrary hcl.Expression,
|
||||
// but here it's always interpreted as a literal string.
|
||||
ID: hcl.StaticExpr(cty.StringVal(args[1]), configs.SynthBody("import", nil).MissingItemRange()),
|
||||
CommandLineImportTarget: &tofu.CommandLineImportTarget{
|
||||
Addr: addr,
|
||||
ID: args[1],
|
||||
},
|
||||
},
|
||||
},
|
||||
|
||||
|
||||
Reference in New Issue
Block a user