LoginSignup
1
0

【Terraform de Azure】 Terraform 実行時の Killed メッセージの対処方法

Last updated at Posted at 2023-07-03

概要

「Infrastructer as Code」ということで、Terraform を用いて Azure環境上に リソースを作成していましたが、久方ぶりに利用すると「Killed」とメッセージが表示され実行不可となってました。 正常に実行されるために対処した方法を記載いたします(色々な方法があると思いますが、私の場合はこれで問題なくクリアできました)。

ローカル環境

  • macOS Ventura 13.0
  • terraform v1.0.11 (エラー前のバージョン)
  • terraform v1.5.2 (正常後のバージョン)

Terraform のバージョンを確認してみる

Killed メッセージの表示

久方ぶりにTerraformを利用しようと、、、、まずは、バージョンを確認を実施。 すると、、、、

$ terraform -v   
zsh: killed     terraform -v

なんだ、このメッセージは?!  ということで以下を実行

$ brew install tfenv
$ brew unlink terraform
$ brew reinstall tfenv
$ tfenv install 1.5.2
$ tfenv use 1.5.2

再度バージョンの確認

$ terraform -v        
Terraform v1.5.2
on darwin_amd64
+ provider registry.terraform.io/hashicorp/azurerm v2.93.0
+ provider registry.terraform.io/hashicorp/tls v3.1.0

念のため、terraform init も実行してみる

$ terraform init

Initializing the backend...

Initializing provider plugins...
- Reusing previous version of hashicorp/azurerm from the dependency lock file
- Reusing previous version of hashicorp/tls from the dependency lock file
- Using previously-installed hashicorp/azurerm v2.93.0
- Using previously-installed hashicorp/tls v3.1.0

Terraform has been successfully initialized!

You may now begin working with Terraform. Try running "terraform plan" to see
any changes that are required for your infrastructure. All Terraform commands
should now work.

If you ever set or change modules or backend configuration for Terraform,
rerun this command to reinitialize your working directory. If you forget, other
commands will detect it and remind you to do so if necessary.

まとめ

これで、以前と同様に Terraform でサクッと Azure環境上にリソースを作成することができるようになりました(この記事を実行確認済)。

1
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
1
0