terraform - Terraform 计划引发提供程序插件错误
问题描述
我正在使用 terraform 进行小型 POC,但无法运行terraform plan
我的代码:
terraform {
backend "azurerm" {
storage_account_name = "appngqastorage"
container_name = "terraform"
key = "qa.terraform.tfstate"
access_key = "my access key here"
}
required_providers {
azurerm = {
source = "hashicorp/azurerm"
version = ">= 2.77"
}
}
}
provider "azurerm" {
features {}
}
resource "azurerm_resource_group" "qa_resource_group" {
location = "East US"
name = "namehere"
}
我的执行:
- terraform init = 成功
- terraform validate = 配置有效
- terraform plan = 抛出异常
错误:
│ Error: Plugin error
│
│ with provider["registry.terraform.io/hashicorp/azurerm"],
│ on main.tf line 15, in provider "azurerm":
│ 15: provider"azurerm"{
│
│ The plugin returned an unexpected error from plugin.(*GRPCProvider).ConfigureProvider: rpc error: code = Internal desc = grpc: error while marshaling: string field contains invalid UTF-8
解决方案
在深入挖掘之后,我能够找出问题所在。
我正在进行的当前项目已在多个地区使用。因此,在测试工作时,我正在交换我的区域,以便正确测试特定区域中显示的数据。这次运行terraform apply
我的 Windows 配置时,它指向了另一个区域,而不是美国。
这个线程帮助我理解。
推荐阅读
- amazon-web-services - 将多服务应用程序部署到云提供商
- c# - Linq 对于谓词和 order by 子句非常慢
- facebook - Facebook Graph API 总是返回 0 作为 CARE 反应的计数
- html - 计时器(用于倒计时)
- python - 马拉雅拉姆语词的词形还原
- python - 如何在 Python 中使用命令行运行可执行文件?
- javascript - 在 vue.js 中与其他表单内容一起上传照片
- html - height:100% 无论我将它应用于什么元素,它似乎都不起作用
- sql - 具有多个条件的 where 子句
- maven - 使用 openapi-generator 生成 ktor 服务器存根的正确方法是什么