LoginSignup
8
3

More than 5 years have passed since last update.

Terraform init実行時にプラグインエラーが発生した場合の対処方法

Posted at

構成について

  • OS: Amazon Linux 2 AMI (HVM), SSD Volume Type - ami-0a2de1c3b415889d2
  • Terraform: v0.11.11

Terraform init実行時にエラー

terraform initの実行時に以下のエラーが発生する場合は、プロバイダ用のプラグインがダウンロードできない場合に発生します。

$ terraform init -upgrade

Initializing provider plugins...
- Checking for available provider plugins on https://releases.hashicorp.com...

Error installing provider "aws": Get https://releases.hashicorp.com/terraform-provider-aws/: proxyconnect tcp: tls: oversized record received with length 20527.

Terraform analyses the configuration and state and automatically downloads
plugins for the providers used. However, when attempting to download this
plugin an unexpected error occured.

This may be caused if for some reason Terraform is unable to reach the
plugin repository. The repository may be unreachable if access is blocked
by a firewall.

If automatic installation is not possible or desirable in your environment,
you may alternatively manually install plugins by downloading a suitable
distribution package and placing the plugin's executable file in the
following directory:
    terraform.d/plugins/linux_amd64

手動でプラグインを配置することで回避することができます。
そのため、terraformを実行するディレクトリ配下に以下のディレクトリを作成し、ファイルを配置します。

$ mkdir -p terraform.d/plugins/linux_amd64
$ cd terraform.d/plugins/linux_amd64/
$ wget https://releases.hashicorp.com/terraform/0.11.11/terraform_0.11.11_linux_amd64.zip
$ unzip terraform_0.11.11_linux_amd64.zip

Terraform initを再度実行し、問題ないことを確認します。

$ terraform init -upgrade

このケースは限定的な環境でしか起こらないと思いますが、もし誰かのお役に立てれば光栄です。

8
3
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
8
3