Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
vincentclee opened this issue Jun 21, 2022 · 0 comments
Labels
bug Something isn't working
Milestone

Comments

@vincentclee
Copy link
Contributor

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()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant