Mongey / terraform-provider-confluentcloud

A Terraform provider for managing resource in confluent.cloud
MIT License
110 stars 47 forks source link

Broken with terraform 13 #32

Closed yottta closed 3 years ago

yottta commented 3 years ago
2020/09/28 11:09:58 [INFO] Terraform version: 0.13.0
2020/09/28 11:09:58 [INFO] Go runtime version: go1.14.2
...
2020/09/28 11:10:00 [INFO] CLI command args: []string{"apply"}
   2020/09/28 11:10:00 [TRACE] Meta.Backend: built configuration for "gcs" backend with hash value 2205733219
   2020/09/28 11:10:00 [TRACE] Preserving existing state lineage "8f853e0d-6d3d-37f8-32a7-fcd9b12d4912"
   2020/09/28 11:10:00 [TRACE] Preserving existing state lineage "8f853e0d-6d3d-37f8-32a7-fcd9b12d4912"
   2020/09/28 11:10:00 [TRACE] Meta.Backend: working directory was previously initialized for "gcs" backend
   2020/09/28 11:10:00 [TRACE] Meta.Backend: using already-initialized, unchanged "gcs" backend configuration
   2020/09/28 11:10:00 [TRACE] Meta.Backend: instantiated backend of type *gcs.Backend
   2020/09/28 11:10:00 [TRACE] providercache.fillMetaCache: scanning directory .terraform/plugins
   2020/09/28 11:10:00 [TRACE] getproviders.SearchLocalDirectory: found github.com/cgroschupp/confluent-cloud v0.0.6 for darwin_amd64 at .terraform/plugins/github.com/cgroschupp/confluent-cloud/0.0.6/darwin_amd64
   2020/09/28 11:10:00 [TRACE] providercache.fillMetaCache: including .terraform/plugins/github.com/cgroschupp/confluent-cloud/0.0.6/darwin_amd64 as a candidate package for github.com/cgroschupp/confluent-cloud 0.0.6
   2020/09/28 11:10:00 [DEBUG] checking for provisioner in "."
   2020/09/28 11:10:00 [DEBUG] checking for provisioner in "/Users/user/data/workspace/softs/bin"
   2020/09/28 11:10:00 [DEBUG] checking for provisioner in "/Users/user/.terraform.d/plugins"
   2020/09/28 11:10:00 [DEBUG] checking for provisioner in "/Users/user/.terraform.d/plugins/darwin_amd64"
   2020/09/28 11:10:00 [INFO] Failed to read plugin lock file .terraform/plugins/darwin_amd64/lock.json: open .terraform/plugins/darwin_amd64/lock.json: no such file or directory
   2020/09/28 11:10:00 [TRACE] Meta.Backend: backend *gcs.Backend does not support operations, so wrapping it in a local backend
   2020/09/28 11:10:00 [INFO] backend/local: starting Apply operation
   2020/09/28 11:10:00 [TRACE] backend/local: requesting state manager for workspace "default"
   2020/09/28 11:10:02 [TRACE] backend/local: requesting state lock for workspace "default"
   2020/09/28 11:10:02 [TRACE] backend/local: reading remote state for workspace "default"
   2020/09/28 11:10:03 [TRACE] backend/local: retrieving local state snapshot for workspace "default"
   2020/09/28 11:10:03 [TRACE] backend/local: building context for current working directory
   2020/09/28 11:10:03 [TRACE] terraform.NewContext: starting
   2020/09/28 11:10:03 [TRACE] terraform.NewContext: loading provider schemas
   2020/09/28 11:10:03 [TRACE] LoadSchemas: retrieving schema for provider type "registry.terraform.io/hashicorp/confluent-cloud"
   2020/09/28 11:10:03 [TRACE] LoadSchemas: retrieving schema for provider type "github.com/cgroschupp/confluent-cloud"
   2020-09-28T11:10:03.198+0300 [INFO]  plugin: configuring client automatic mTLS
   2020-09-28T11:10:03.234+0300 [DEBUG] plugin: starting plugin: path=.terraform/plugins/github.com/cgroschupp/confluent-cloud/0.0.6/darwin_amd64/terraform-provider-confluent-cloud_v0.0.6 args=[.terraform/plugins/github.com/cgroschupp/confluent-cloud/0.0.6/darwin_amd64/terraform-provider-confluent-cloud_v0.0.6]
   2020-09-28T11:10:03.239+0300 [DEBUG] plugin: plugin started: path=.terraform/plugins/github.com/cgroschupp/confluent-cloud/0.0.6/darwin_amd64/terraform-provider-confluent-cloud_v0.0.6 pid=5574
   2020-09-28T11:10:03.239+0300 [DEBUG] plugin: waiting for RPC address: path=.terraform/plugins/github.com/cgroschupp/confluent-cloud/0.0.6/darwin_amd64/terraform-provider-confluent-cloud_v0.0.6
   2020-09-28T11:10:03.250+0300 [DEBUG] plugin.terraform-provider-confluent-cloud_v0.0.6: 2020/09/28 11:10:03 [INFO] Creating Provider
   2020-09-28T11:10:03.251+0300 [INFO]  plugin.terraform-provider-confluent-cloud_v0.0.6: configuring server automatic mTLS: timestamp=2020-09-28T11:10:03.251+0300
   2020-09-28T11:10:03.279+0300 [DEBUG] plugin: using plugin: version=5
   2020-09-28T11:10:03.279+0300 [DEBUG] plugin.terraform-provider-confluent-cloud_v0.0.6: plugin address: address=/var/folders/8x/y2xr62qs19g1yzysh9nqxtqs3qrbq0/T/plugin214785797 network=unix timestamp=2020-09-28T11:10:03.279+0300
   2020-09-28T11:10:03.346+0300 [TRACE] plugin.stdio: waiting for stdio data
   2020/09/28 11:10:03 [TRACE] GRPCProvider: GetSchema
   2020-09-28T11:10:03.347+0300 [WARN]  plugin.stdio: received EOF, stopping recv loop: err="rpc error: code = Unimplemented desc = unknown service plugin.GRPCStdio"
   2020/09/28 11:10:03 [TRACE] No provider meta schema returned
   2020/09/28 11:10:03 [TRACE] GRPCProvider: Close
   2020-09-28T11:10:03.355+0300 [DEBUG] plugin: plugin process exited: path=.terraform/plugins/github.com/cgroschupp/confluent-cloud/0.0.6/darwin_amd64/terraform-provider-confluent-cloud_v0.0.6 pid=5574
   2020-09-28T11:10:03.355+0300 [DEBUG] plugin: plugin exited

   Error: Could not load plugin

   Plugin reinitialization required. Please run "terraform init".

   Plugins are external binaries that Terraform uses to access and manipulate
   resources. The configuration provided requires plugins which can't be located,
   don't satisfy the version constraints, or are otherwise incompatible.

   Terraform automatically discovers provider requirements from your
   configuration, including providers used in child modules. To see the
   requirements and constraints, run "terraform providers".

   Failed to instantiate provider
   "registry.terraform.io/hashicorp/confluent-cloud" to obtain schema: unknown
   provider "registry.terraform.io/hashicorp/confluent-cloud"

I am trying to migrate to terraform 13 but the plugin is not working with it. I don't have a proper provider development environment but I tried to update the go terraform dependency, built it, but still doesn't work. Can you take a look and provide a new version that works with terraform 13?

Thanks

rjudin commented 3 years ago

@yottta I do not have such issues on my end with Terraform v0.13.2 :) please ensure that you have configured the provider in a 'new' way

terraform {
  required_providers {
    # https://github.com/Mongey/terraform-provider-confluentcloud
    confluentcloud = {
      source = "mongey/confluentcloud"
      version = "0.0.5"
    }

    # https://github.com/Mongey/terraform-provider-kafka
    kafka = {
      source  = "mongey/kafka"
      version = "0.2.10"
    }
  }
  required_version = "0.13.2"
}

and use it after all as:

locals {
  bootstrap_servers = [replace(confluentcloud_kafka_cluster.env0_test.bootstrap_servers, "SASL_SSL://", "")]
}

provider "confluentcloud" {
  username = var.confluent_username
  password = var.confluent_paswword
}

provider "kafka" {
  bootstrap_servers = local.bootstrap_servers

  tls_enabled    = true
  sasl_username  = confluentcloud_api_key.env0_test.key
  sasl_password  = confluentcloud_api_key.env0_test.secret
  sasl_mechanism = "plain"
}
yottta commented 3 years ago

Thanks @rjudin.

I tried it, and it works indeed. But this might be because the providers are fetched from the terraform registry, which were not before (cause were not pushed).

And for confluentcloud, I used a fork of it (I don't remember the reason now, but I'm more than sure that was a bug at some point), which is not published to registry, so I needed to use from a local file but for this the documentation on terraform 13 it's pretty foggy.

Anyway, thanks for this! I will close the issue for now.