44 "context"
55 "fmt"
66
7- "github.com/doublecloud/go-genproto/doublecloud/kafka/v1"
8- dcsdk "github.com/doublecloud/go-sdk"
9- dcgen "github.com/doublecloud/go-sdk/gen/kafka"
107 "github.com/hashicorp/terraform-plugin-framework-validators/stringvalidator"
118 "github.com/hashicorp/terraform-plugin-framework/attr"
129 "github.com/hashicorp/terraform-plugin-framework/diag"
@@ -21,6 +18,10 @@ import (
2118 "github.com/hashicorp/terraform-plugin-framework/types"
2219 "github.com/hashicorp/terraform-plugin-log/tflog"
2320 "google.golang.org/protobuf/types/known/wrapperspb"
21+
22+ "github.com/doublecloud/go-genproto/doublecloud/kafka/v1"
23+ dcsdk "github.com/doublecloud/go-sdk"
24+ dcgen "github.com/doublecloud/go-sdk/gen/kafka"
2425)
2526
2627// Ensure provider defined types fully satisfy framework interfaces.
@@ -46,7 +47,7 @@ type KafkaClusterModel struct {
4647 Name types.String `tfsdk:"name"`
4748 Description types.String `tfsdk:"description"`
4849 Version types.String `tfsdk:"version"`
49- Resources KafkaResourcesModel `tfsdk:"resources"`
50+ Resources * KafkaResourcesModel `tfsdk:"resources"`
5051 NetworkId types.String `tfsdk:"network_id"`
5152 SchemaRegistry * schemaRegistryModel `tfsdk:"schema_registry"`
5253 Access * AccessModel `tfsdk:"access"`
@@ -358,7 +359,23 @@ func (r *KafkaClusterResource) Read(ctx context.Context, req resource.ReadReques
358359 data .Description = types .StringValue (rs .Description )
359360 data .CloudType = types .StringValue (rs .CloudType )
360361 data .RegionID = types .StringValue (rs .RegionId )
362+ data .NetworkId = types .StringValue (rs .NetworkId )
361363 data .Version = types .StringValue (rs .Version )
364+ data .Resources = & KafkaResourcesModel {
365+ Kafka : KafkaResourcesKafkaModel {
366+ ResourcePresetId : types .StringValue (rs .GetResources ().GetKafka ().GetResourcePresetId ()),
367+ DiskSize : types .Int64Value (rs .GetResources ().GetKafka ().GetDiskSize ().GetValue ()),
368+ BrokerCount : types .Int64Value (rs .GetResources ().GetKafka ().GetBrokerCount ().GetValue ()),
369+ ZoneCount : types .Int64Value (rs .GetResources ().GetKafka ().GetZoneCount ().GetValue ()),
370+ },
371+ }
372+
373+ if access := rs .GetAccess (); access != nil {
374+ if data .Access == nil {
375+ data .Access = new (AccessModel )
376+ }
377+ diag .Append (data .Access .parse (access )... )
378+ }
362379
363380 if rs .SchemaRegistryConfig != nil {
364381 data .SchemaRegistry = & schemaRegistryModel {Enabled : types .BoolValue (rs .SchemaRegistryConfig .Enabled )}
0 commit comments