Skip to content

DestroyPlugin & PassPlanFilePlugin - Terraform Destroy can't be called with a plan file #417

@vincentclee

Description

@vincentclee

The DestroyPlugin does not play nicely with PassPlanFilePlugin.

Error Message

 + terraform destroy -input=false -auto-approve tfplan-uat
 ╷
 │ Error: Destroy can't be called with a plan file
 │ 
 │ If this plan was created using plan -destroy, apply it using:
 │   terraform apply "tfplan-uat"
 ╵

Jenkinsfile

Jenkinsfile.init(this)
PassPlanFilePlugin.init()
DestroyPlugin.init()

def validate = new TerraformValidateStage()
def destroyUat = new TerraformEnvironmentStage("uat")

validate.then(destroyUat).build()

Terraform Command: destroy

The terraform destroy command accepts most of the options that terraform apply accepts, although it does not accept a plan file argument and forces the selection of the "destroy" planning mode.

https://www.terraform.io/cli/commands/destroy

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions