@@ -45,7 +45,6 @@ func (c *ImportCommand) Run(args []string) int {
4545 cmdFlags .StringVar (& configPath , "config" , pwd , "path" )
4646 cmdFlags .BoolVar (& c .Meta .stateLock , "lock" , true , "lock state" )
4747 cmdFlags .DurationVar (& c .Meta .stateLockTimeout , "lock-timeout" , 0 , "lock timeout" )
48- cmdFlags .BoolVar (& c .Meta .allowMissingConfig , "allow-missing-config" , false , "allow missing config" )
4948 cmdFlags .Usage = func () { c .Ui .Error (c .Help ()) }
5049 if err := cmdFlags .Parse (args ); err != nil {
5150 return 1
@@ -135,7 +134,7 @@ func (c *ImportCommand) Run(args []string) int {
135134 break
136135 }
137136 }
138- if ! c . Meta . allowMissingConfig && rc == nil {
137+ if rc == nil {
139138 modulePath := addr .Module .String ()
140139 if modulePath == "" {
141140 modulePath = "the root module"
@@ -262,10 +261,6 @@ func (c *ImportCommand) Run(args []string) int {
262261
263262 c .Ui .Output (c .Colorize ().Color ("[reset][green]\n " + importCommandSuccessMsg ))
264263
265- if c .Meta .allowMissingConfig && rc == nil {
266- c .Ui .Output (c .Colorize ().Color ("[reset][yellow]\n " + importCommandAllowMissingResourceMsg ))
267- }
268-
269264 c .showDiagnostics (diags )
270265 if diags .HasErrors () {
271266 return 1
@@ -310,8 +305,6 @@ Options:
310305 If no config files are present, they must be provided
311306 via the input prompts or env vars.
312307
313- -allow-missing-config Allow import when no resource configuration block exists.
314-
315308 -input=false Disable interactive input prompts.
316309
317310 -lock=false Don't hold a state lock during the operation. This is
@@ -361,12 +354,3 @@ const importCommandSuccessMsg = `Import successful!
361354The resources that were imported are shown above. These resources are now in
362355your Terraform state and will henceforth be managed by Terraform.
363356`
364-
365- const importCommandAllowMissingResourceMsg = `Import does not generate resource configuration, you must create a resource
366- configuration block that matches the current or desired state manually.
367-
368- If there is no matching resource configuration block for the imported
369- resource, Terraform will delete the resource on the next "terraform apply".
370- It is recommended that you run "terraform plan" to verify that the
371- configuration is correct and complete.
372- `
0 commit comments