Skip to content

Commit

Permalink
Adding destroy attribute to the apply
Browse files Browse the repository at this point in the history
  • Loading branch information
sergJozee committed Jan 12, 2023
1 parent f4c2f57 commit dfed333
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/Cake.Terraform/Apply/TerraformApplyRunner.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
Expand Down
5 changes: 5 additions & 0 deletions src/Cake.Terraform/Apply/TerraformApplySettings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,5 +25,10 @@ public class TerraformApplySettings : TerraformSettings
/// https://www.terraform.io/docs/commands/apply.html#auto-approve
/// </summary>
public bool AutoApprove { get; set; }

/// <summary>
/// Does destory
/// </summary>
public bool Destroy { get; set; }
}
}

0 comments on commit dfed333

Please sign in to comment.