0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

Terraform Cloud 環境で 0.13 より古いものから Upgrade して発生した Invalid legacy provider address の対応

Posted at

概要

  • GitHub.com と Terraform Cloud 利用環境(state を Terraform Cloud で管理している)
  • Terraform Cloud の Workspace の terraform version を 0.13 より古いものから最新版(1.2.1)に Upgrade したところ、terraform plan で Invalid legacy provider address が発生するようになってしまった。
    • provider も最新化している。

エラー詳細

│ Error: Invalid legacy provider address
│ 
│ This configuration or its associated state refers to the unqualified
│ provider "google".
│ 
│ You must complete the Terraform 0.13 upgrade process before upgrading to
│ later versions.

原因

  • Terraform アップグレードに伴う、 google providor の更新が必要

対応

  • Cloud でも local でも terraform plan すると、同じ Invalid legacy provider address になってしまう。
  • とりあえずLocalで terraform login して、terraform init し、Invalid legacy provider address が表示されても、 .terraform 配下に backend 情報が生成される。
  • state を replace する(具体的には以下)
    • terraform state replace-provider registry.terraform.io/-/google registry.terraform.io/hashicorp/google
  • そうすると、 terraform initterraform plan が通るようになった。
    • .terraform.lock.hcl が生成されるように変わるので、忘れずコミットする。

参考にしたもの

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?