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 authored and nils-a committed May 23, 2024
1 parent b39c224 commit 18ca1c8
Show file tree
Hide file tree
Showing 2 changed files with 11 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
6 changes: 6 additions & 0 deletions src/Cake.Terraform/Apply/TerraformApplySettings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -36,5 +36,11 @@ public TerraformApplySettings()
/// <see>https://www.terraform.io/docs/commands/apply.html#input-true</see>
/// </summary>
public bool Input { get; set; }

/// <summary>
/// Does destory
/// <see>https://www.terraform.io/docs/commands/destroy.html</see>
/// </summary>
public bool Destroy { get; set; }
}
}

0 comments on commit 18ca1c8

Please sign in to comment.