Search code examples
terraformterraform-provider-azureterraform-provider-gcpazure-rm

Terraform plan throws Provider Plugin Error


I am doing a small POC with terraform and I am unable to run terraform plan

My code:

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"
} 

My execution:

  1. terraform init = success
  2. terraform validate = configuration is valid
  3. terraform plan = throws exception

Error:

│ 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

Solution

  • After digging a little deeper I was able to figure out what was the issue.

    Current project I am working on is been utilized within multiple regions. So, when testing work I am swapping my region in order to properly test the data that displays in specific region. This time when running terraform apply my windows configuration was pointing to another region not the US.

    This thread helped me understand.