implement Import
diff --git a/tfexec/terraform.go b/tfexec/terraform.go index 97d745a..5ce02bc 100644 --- a/tfexec/terraform.go +++ b/tfexec/terraform.go
@@ -498,6 +498,20 @@ conf.varFile = opt.path } +func (t *Terraform) Import(ctx context.Context, opts ...ImportOption) error { + importCmd := t.ImportCmd(ctx, opts...) + + var errBuf strings.Builder + importCmd.Stderr = &errBuf + + err := importCmd.Run() + if err != nil { + return parseError(errBuf.String()) + } + + return nil +} + type outputConfig struct { state string json bool