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?

Terraform Tutorialをやっていて困ったところ

Last updated at Posted at 2025-09-13

はじめに

熟練者には当たり前でも、初学者は中々わからないパターンもあるので忘備録として作成

起こったこと

Terraformのturorialを進めていて、20個目あたりで下記のような状態で止まるようになった。

aws_s3_bucket.dev: Refreshing state... 

原因

git cloneしてきた際に.terraform.lock.hclファイルがある。このファイルはPJにおける環境の統一が目的になっているが、それが原因で古いプロバイダーバージョンをインストールしてしまっていた。
(tutorial作成時のバージョンではawsプロバイダーのそれが低かったんだな〜)

対策

意図的にプロバイダーを更新する

 terraform init -upgrade

場合によっては一度stateファイルや生成ファイルを削除して再生成するとうまく行くこともある。

 rm -rf .terraform .terraform.lock.hcl
 ↓
 terraform init

資料

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?