Skip to content

TfvarsFilesPlugin & PassPlanFilePlugin - Can't set variables when applying a saved plan #436

@vincentclee

Description

@vincentclee

The TfvarsFilesPlugin does not play nicely with PassPlanFilePlugin.

Error Message

+ terraform apply -input=false -auto-approve -var-file=./variables/uat.tfvars tfplan-uat
╷
│ Error: Can't set variables when applying a saved plan
│ 
│ The -var and -var-file options cannot be used when applying a saved plan
│ file, because a saved plan includes the variable values that were set when
│ it was created.
╵

Related issue: #417

Jenkinsfile

Jenkinsfile.init(this)
PassPlanFilePlugin.init()
TfvarsFilesPlugin.withDirectory('./variables').init()

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

validate.then(deploy).build()

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