diff --git a/src/Cake.Terraform/Apply/TerraformApplyRunner.cs b/src/Cake.Terraform/Apply/TerraformApplyRunner.cs index 9d9319a..7529053 100644 --- a/src/Cake.Terraform/Apply/TerraformApplyRunner.cs +++ b/src/Cake.Terraform/Apply/TerraformApplyRunner.cs @@ -17,6 +17,11 @@ public void Run(TerraformApplySettings settings) var builder = new ProcessArgumentBuilder() .Append("apply"); + if (settings.Destroy) + { + builder.Append("-destroy"); + } + // Order of AutoApprove and Plan are important. if (settings.AutoApprove) { diff --git a/src/Cake.Terraform/Apply/TerraformApplySettings.cs b/src/Cake.Terraform/Apply/TerraformApplySettings.cs index 3cf537f..f199faa 100644 --- a/src/Cake.Terraform/Apply/TerraformApplySettings.cs +++ b/src/Cake.Terraform/Apply/TerraformApplySettings.cs @@ -25,5 +25,10 @@ public class TerraformApplySettings : TerraformSettings /// https://www.terraform.io/docs/commands/apply.html#auto-approve /// public bool AutoApprove { get; set; } + + /// + /// Does destory + /// + public bool Destroy { get; set; } } } \ No newline at end of file