diff --git a/build.py b/build.py index efa2700..ca49c95 100644 --- a/build.py +++ b/build.py @@ -28,7 +28,7 @@ use_plugin("python.distutils") default_task = "publish" name = "ddadevops" -version = "0.4.2.dev0" +version = "0.4.2.dev1" summary = "tools to support builds combining gopass, terraform, dda-pallet, aws & hetzner-cloud" description = __doc__ authors = [Author("meissa GmbH", "buero@meissa-gmbh.de")] diff --git a/src/main/python/ddadevops/devops_terraform_build.py b/src/main/python/ddadevops/devops_terraform_build.py index 515f1c6..6a0c731 100644 --- a/src/main/python/ddadevops/devops_terraform_build.py +++ b/src/main/python/ddadevops/devops_terraform_build.py @@ -103,15 +103,17 @@ class DevopsTerraformBuild(DevopsBuild): def apply(self, p_auto_approve=False): tf = self.init_client() self.print_terraform_command('apply') - kwargs = {"auto-approve": p_auto_approve} - tf.apply(capture_output=False, var=self.project_vars(),**kwargs) + tf.apply(capture_output=False, var=self.project_vars(),skip_plan=p_auto_approve) self.write_output(tf) def destroy(self, p_auto_approve=False): tf = self.init_client() self.print_terraform_command('destroy') - kwargs = {"auto-approve": p_auto_approve} - tf.destroy(capture_output=False, var=self.project_vars(),**kwargs) + if p_auto_approve: + force=IsFlagged + else: + force=None + tf.destroy(capture_output=False, force=force, var=self.project_vars()) def tf_import(self, tf_import_name, tf_import_resource,): tf = self.init_client()