diff --git a/internal/sdkprovider/service/kafka/kafka_quota.go b/internal/sdkprovider/service/kafka/kafka_quota.go index 29e188c44..af03b6a3a 100644 --- a/internal/sdkprovider/service/kafka/kafka_quota.go +++ b/internal/sdkprovider/service/kafka/kafka_quota.go @@ -3,7 +3,6 @@ package kafka import ( "context" "fmt" - avngen "github.com/aiven/go-client-codegen" "github.com/aiven/go-client-codegen/handler/kafka" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" @@ -163,6 +162,10 @@ func resourceKafkaQuotaRead(ctx context.Context, d *schema.ResourceData, client params = append(params, kafka.ServiceKafkaQuotaDescribeClientId(clientID)) } + if len(params) == 0 { + return fmt.Errorf("invalid resource ID: %q, either user or client_id must be set", d.Id()) + } + resp, err := client.ServiceKafkaQuotaDescribe( ctx, project, @@ -170,14 +173,7 @@ func resourceKafkaQuotaRead(ctx context.Context, d *schema.ResourceData, client params..., ) if err != nil { - return fmt.Errorf( - "cannot get Kafka quota for project %q, service %q:, client_id %q, user %q: %w", - project, - serviceName, - clientID, - user, - err, - ) + return err } return schemautil.ResourceDataSet(