I tried to create API Key for Schema Registry using Service Account.
...
resource "confluentcloud_service_account" "service_account" {
name = local.service-account-name
description = "default service_account"
}
resource "confluentcloud_api_key" "kafka_schema_registry_api_key" {
cluster_id = confluentcloud_schema_registry.schema_registry.id
environment_id = confluentcloud_environment.env.id
description = "Service Account Schema Registry API Key"
user_id = confluentcloud_service_account.service_account.id
}
I expected similar result as doing ccloud api-key create --service-account {sa-...} --resource {lsrc-..}
But after apply, I got error:
confluentcloud_api_key.kafka_schema_registry_api_key: Still creating... [10s elapsed]
╷
│ Error: Plugin did not respond
│
│ with confluentcloud_api_key.kafka_schema_registry_api_key,
│ on kafka.tf line 36, in resource "confluentcloud_api_key" "kafka_schema_registry_api_key":
│ 36: resource "confluentcloud_api_key" "kafka_schema_registry_api_key" {
│
│ The plugin encountered an error, and failed to respond to the
│ plugin.(*GRPCProvider).ApplyResourceChange call. The plugin logs may
│ contain more details.
╵
Stack trace from the terraform-provider-confluentcloud_v0.0.12 plugin:
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x58 pc=0xea36e8]
goroutine 14 [running]:
github.com/Mongey/terraform-provider-confluentcloud/ccloud.clusterReady.func1(0xc000299ee0, 0xc000299ea0, 0x0, 0x0, 0x2, 0x1)
/home/runner/work/terraform-provider-confluentcloud/terraform-provider-confluentcloud/ccloud/resource_kafka_cluster.go:200 +0xc8
github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource.(*StateChangeConf).WaitForStateContext.func1(0xc000458900, 0xc000124460, 0xc0000412c0, 0xc0005ccf00, 0xc0001ae7b8, 0xc0001ae7b0)
/home/runner/go/pkg/mod/github.com/hashicorp/terraform-plugin-sdk/v2@v2.7.0/helper/resource/state.go:110 +0x2e9
created by github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource.(*StateChangeConf).WaitForStateContext
/home/runner/go/pkg/mod/github.com/hashicorp/terraform-plugin-sdk/v2@v2.7.0/helper/resource/state.go:83 +0x1c6
Error: The terraform-provider-confluentcloud_v0.0.12 plugin crashed!
I tried to create API Key for Schema Registry using Service Account.
I expected similar result as doing
ccloud api-key create --service-account {sa-...} --resource {lsrc-..}But after apply, I got error: