Skip to content

Commit

Permalink
Perform backend check after code is downloaded
Browse files Browse the repository at this point in the history
  • Loading branch information
brikis98 committed Sep 29, 2017
1 parent d7215e5 commit f21f32b
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions cli/cli_app.go
Original file line number Diff line number Diff line change
Expand Up @@ -204,6 +204,12 @@ func runTerragrunt(terragruntOptions *options.TerragruntOptions) error {
}
}

if terragruntConfig.RemoteState != nil {
if err := checkTerraformCodeDefinesBackend(terragruntOptions, terragruntConfig.RemoteState.Backend); err != nil {
return err
}
}

return runTerragruntWithConfig(terragruntOptions, terragruntConfig, false)
}

Expand Down Expand Up @@ -243,10 +249,6 @@ func prepareInitCommand(terragruntOptions *options.TerragruntOptions, terragrunt
}

if terragruntConfig.RemoteState != nil {
if err := checkTerraformCodeDefinesBackend(terragruntOptions, terragruntConfig.RemoteState.Backend); err != nil {
return err
}

// Initialize the remote state if necessary (e.g. create S3 bucket and DynamoDB table)
remoteStateNeedsInit, err := remoteStateNeedsInit(terragruntConfig.RemoteState, terragruntOptions)
if err != nil {
Expand Down

0 comments on commit f21f32b

Please sign in to comment.