Closed gdespoulain closed 1 year ago
I can confirm this issue.
I have the same issue using gitlab ci !
I can also confirm this issue. Any plan, when it will be fixed?
Hi. I was facing same issue, but I was using publishPlanResults: tfplan (tfplan was same as my -out) After changing publishPlanResults to something random, it worked. Somewhere in documentation it states you should not use the same file as the output plan. If yuo do this, the output plan gets overwritten with text file, and it is not binary anymore, and hence it fails to apply.
So change publishPlanResults: plan.tfplan to publishPlanResults: plan
Hi, the "publishPlanResults" is meant to be the name of the tab in Azure Devops web page which shows the plan output, not the name of the terraform plan used to store terraform data. As @ricklahaye says, naming these the same will cause issues.
Not a bug, but we can take a look if the documentation can make this situation clearer.
Thank you! :)
I just got bitten by this today (wasted 4 hours before finding this issue). Something in the docs would be great!
Will be resolved by #339.
Bug Description
Hello! :)
I'm using
terraform plan -out="terraform.tfplan"
in one stage, and then applying said plan using the plan text file (passed as an artifact) in another stage:terraform apply terraform.tfplan
. During the plan task I use the publishPlanResults as option.The plan is valid and shown properly in the Terraform Plan tab. However, I get this error during apply:
I researched a bit and found out it seems to be a problem for Terraform to process the plan after it has been used by publishPlanResults. At least it's the theory that has been discussed at the end of this thread: https://github.com/hashicorp/terraform/issues/22396 where they could also reproduce the problem.
To Reproduce
Steps to reproduce the behavior:
1. Setup pipeline as:
2. Execute pipeline
Let both stages run. The plan is saved accordingly and available in apply stage.
The error appears in the log. It's gone when I remove the publishPlanResults option.
Expected behavior
I would like to use both the publishPlanResults option and a saved plan :)
Agent Configuration
Thank you!