【发布时间】:2021-05-06 23:34:40
【问题描述】:
错误:此模块尚未安装。运行“terraform init”安装所有模块 此配置需要。
我尝试了 terraform init,即使之后我看到了同样的问题。
这些是 terraform show 的输出
Reason: Backend configuration changed for "s3"
The "backend" is the interface that Terraform uses to store state,
perform operations, etc. If this message is showing up, it means that the
Terraform configuration you're using is using a custom configuration for
the Terraform backend.
Changes to backend configurations require reinitialization. This allows
Terraform to setup the new configuration, copy existing state, etc. This is
only done during "terraform init". Please run that command now then try again.
If the change reason above is incorrect, please verify your configuration
hasn't changed and try again. At this point, no changes to your existing
configuration or state have been made.
Failed to load backend: Initialization required. Please see the error message above.```
Could someone help to resolve the issue.
【问题讨论】:
-
你的后端块是什么样的?
-
terraform { backend "s3" { bucket = "sandbox-terraform" key = "terraform.tfstate" region = "us-east-1" profile = "test" } }@CarloMencarelli -
谢谢。
terraform init返回什么? -
` 成功配置后端“s3”!除非后端配置发生更改,否则 Terraform 将自动使用此后端。 Terraform 已成功初始化!您现在可以开始使用 Terraform。尝试运行“terraform plan”以查看基础架构所需的任何更改。所有 Terraform 命令现在应该可以工作了。如果您曾经为 Terraform 设置或更改模块或后端配置,请重新运行此命令以重新初始化您的环境。如果您忘记了,其他命令会检测到它并在必要时提醒您这样做。`
标签: terraform terraform-provider-aws