2626COMMANDS:
2727 apply Acquire a lock and run 'terraform apply'
2828 destroy Acquire a lock and run 'terraform destroy'
29+ import Acquire a lock and run 'terraform import'
30+ remote push Acquire a lock and run 'terraform remote push'
2931 release-lock Release a lock that is left over from some previous command
3032 * Terragrunt forwards all other commands directly to Terraform
3133{{if .VisibleFlags}}
@@ -146,7 +148,7 @@ func configureRemoteState(cliContext *cli.Context, remoteState *remote.RemoteSta
146148 // We only configure remote state for the commands that use the tfstate files. We do not configure it for
147149 // commands such as "get" or "version".
148150 switch cliContext .Args ().First () {
149- case "apply" , "destroy" , "graph" , "output" , "plan" , "push" , "refresh" , "show" , "taint" , "untaint" , "validate" :
151+ case "apply" , "destroy" , "import" , " graph" , "output" , "plan" , "push" , "refresh" , "show" , "taint" , "untaint" , "validate" :
150152 return remoteState .ConfigureRemoteState ()
151153 case "remote" :
152154 if cliContext .Args ().Get (1 ) == "config" {
@@ -166,8 +168,14 @@ func configureRemoteState(cliContext *cli.Context, remoteState *remote.RemoteSta
166168// Run the given Terraform command with the given lock (if the command requires locking)
167169func runTerraformCommandWithLock (cliContext * cli.Context , lock locks.Lock ) error {
168170 switch cliContext .Args ().First () {
169- case "apply" , "destroy" :
171+ case "apply" , "destroy" , "import" :
170172 return locks .WithLock (lock , func () error { return runTerraformCommand (cliContext ) })
173+ case "remote" :
174+ if cliContext .Args ().Get (1 ) == "push" {
175+ return locks .WithLock (lock , func () error { return runTerraformCommand (cliContext ) })
176+ } else {
177+ return runTerraformCommand (cliContext )
178+ }
171179 case "release-lock" :
172180 return runReleaseLockCommand (cliContext , lock )
173181 default :
0 commit comments