[英]Terraform version error when deploying to AWS through jenkins?
I was deploying using terraform through Jenkins Terraform v0.10.7 .我正在通过 Jenkins Terraform v0.10.7使用 terraform 进行部署。 After a success deployment from my local machine using Terraform v0.11.1 , I can not do it again from Jenkins, I have this error :
使用Terraform v0.11.1从我的本地机器成功部署后,我无法从 Jenkins 再次执行此操作,出现此错误:
Terraform doesn't allow running any operations against a state
that was written by a future Terraform version. The state is
reporting it is written by Terraform '0.11.1'.
$ terraform destroy
$ terraform destroy
.tfstate
file.tfstate
文件$ terraform apply
$ terraform apply
If you are using TFE maybe you can re-queue the previous state created with 0.11.x.如果您正在使用 TFE,也许您可以重新排队使用 0.11.x 创建的先前状态。 Or perhaps you can look in Jenkins history to get the last state created with 0.11.x.
或者,您可以查看 Jenkins 历史记录以获取使用 0.11.x 创建的最后一个状态。
A colleague of mine, Manuel Sierra has bumped into this error and concluded with the following solution: (Be careful with the following, it is going to give version errors if you happen to downgrade to another version incompatible with the code)我的一位同事 Manuel Sierra 遇到了这个错误,并得出了以下解决方案:(请注意以下内容,如果您碰巧降级到与代码不兼容的另一个版本,则会出现版本错误)
In our case, downgrade from 0.11.14
to 0.11.13
yielded no errors.在我们的例子中,从
0.11.14
降级到0.11.13
没有产生错误。
terraform pull state > current.state
terraform pull state > current.state
terraform push state current.state
terraform push state current.state
Now you are good to go with the downgraded version.现在您可以使用降级版本了。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.