@@ -28,6 +28,7 @@ import (
2828 "github.com/hashicorp/terraform-plugin-framework/resource/schema"
2929 "github.com/hashicorp/terraform-plugin-framework/resource/schema/boolplanmodifier"
3030 "github.com/hashicorp/terraform-plugin-framework/resource/schema/int32planmodifier"
31+ "github.com/hashicorp/terraform-plugin-framework/resource/schema/int64planmodifier"
3132 "github.com/hashicorp/terraform-plugin-framework/resource/schema/planmodifier"
3233 "github.com/hashicorp/terraform-plugin-framework/resource/schema/stringdefault"
3334 "github.com/hashicorp/terraform-plugin-framework/resource/schema/stringplanmodifier"
@@ -87,8 +88,8 @@ type InstanceResourceModel struct {
8788 Status types.String `tfsdk:"status"`
8889 CreatedAt types.String `tfsdk:"created_at"`
8990 MetricsIntegrationUrl types.String `tfsdk:"metrics_integration_url"`
90- GraphNodes types.Int32 `tfsdk:"graph_nodes"`
91- GraphRelationships types.Int32 `tfsdk:"graph_relationships"`
91+ GraphNodes types.Int64 `tfsdk:"graph_nodes"`
92+ GraphRelationships types.Int64 `tfsdk:"graph_relationships"`
9293 SecondariesCount types.Int32 `tfsdk:"secondaries_count"`
9394 CdcEnrichmentMode types.String `tfsdk:"cdc_enrichment_mode"`
9495 VectorOptimized types.Bool `tfsdk:"vector_optimized"`
@@ -149,8 +150,8 @@ func (r *InstanceResource) Schema(ctx context.Context, request resource.SchemaRe
149150 },
150151 },
151152 "name" : schema.StringAttribute {
152- MarkdownDescription : "Name if the instance" ,
153- Description : "Name if the instance" ,
153+ MarkdownDescription : "Name of the instance" ,
154+ Description : "Name of the instance" ,
154155 Required : true ,
155156 },
156157 "region" : schema.StringAttribute {
@@ -280,20 +281,20 @@ func (r *InstanceResource) Schema(ctx context.Context, request resource.SchemaRe
280281 stringplanmodifier .UseStateForUnknown (),
281282 },
282283 },
283- "graph_nodes" : schema.Int32Attribute {
284+ "graph_nodes" : schema.Int64Attribute {
284285 MarkdownDescription : "Number of nodes in the graph (free-db only)" ,
285286 Description : "Number of nodes in the graph (free-db only)" ,
286287 Computed : true ,
287- PlanModifiers : []planmodifier.Int32 {
288- int32planmodifier .UseStateForUnknown (),
288+ PlanModifiers : []planmodifier.Int64 {
289+ int64planmodifier .UseStateForUnknown (),
289290 },
290291 },
291- "graph_relationships" : schema.Int32Attribute {
292+ "graph_relationships" : schema.Int64Attribute {
292293 MarkdownDescription : "Number of relationships in the graph (only for free-db)" ,
293294 Description : "Number of relationships in the graph (only for free-db)" ,
294295 Computed : true ,
295- PlanModifiers : []planmodifier.Int32 {
296- int32planmodifier .UseStateForUnknown (),
296+ PlanModifiers : []planmodifier.Int64 {
297+ int64planmodifier .UseStateForUnknown (),
297298 },
298299 },
299300 "secondaries_count" : schema.Int32Attribute {
@@ -444,32 +445,32 @@ func (r *InstanceResource) Create(ctx context.Context, request resource.CreateRe
444445 data .MetricsIntegrationUrl = types .StringNull ()
445446 }
446447 if instance .Data .GraphNodes != nil {
447- graphNodes , err := strconv .Atoi (* instance .Data .GraphNodes )
448+ graphNodes , err := strconv .ParseInt (* instance .Data .GraphNodes , 10 , 64 )
448449 if err != nil {
449450 response .Diagnostics .AddWarning (
450451 "Error while parsing graph nodes" ,
451452 fmt .Sprintf ("Cannot convert value to int: %s" , * instance .Data .GraphNodes ),
452453 )
453- data .GraphNodes = types .Int32Null ()
454+ data .GraphNodes = types .Int64Null ()
454455 } else {
455- data .GraphNodes = types .Int32Value ( int32 ( graphNodes ) )
456+ data .GraphNodes = types .Int64Value ( graphNodes )
456457 }
457458 } else {
458- data .GraphNodes = types .Int32Null ()
459+ data .GraphNodes = types .Int64Null ()
459460 }
460461 if instance .Data .GraphRelationships != nil {
461- graphRelationships , err := strconv .Atoi (* instance .Data .GraphRelationships )
462+ graphRelationships , err := strconv .ParseInt (* instance .Data .GraphRelationships , 10 , 64 )
462463 if err != nil {
463464 response .Diagnostics .AddWarning (
464465 "Error while parsing graph relationships" ,
465466 fmt .Sprintf ("Cannot convert value to int: %s" , * instance .Data .GraphNodes ),
466467 )
467- data .GraphRelationships = types .Int32Null ()
468+ data .GraphRelationships = types .Int64Null ()
468469 } else {
469- data .GraphRelationships = types .Int32Value ( int32 ( graphRelationships ) )
470+ data .GraphRelationships = types .Int64Value ( graphRelationships )
470471 }
471472 } else {
472- data .GraphRelationships = types .Int32Null ()
473+ data .GraphRelationships = types .Int64Null ()
473474 }
474475 if instance .Data .SecondariesCount != nil {
475476 data .SecondariesCount = types .Int32Value (int32 (* instance .Data .SecondariesCount ))
@@ -548,30 +549,30 @@ func (r *InstanceResource) Read(ctx context.Context, request resource.ReadReques
548549 stateData .MetricsIntegrationUrl = types .StringNull ()
549550 }
550551 if instance .Data .GraphNodes != nil {
551- graphNodes , err := strconv .Atoi (* instance .Data .GraphNodes )
552+ graphNodes , err := strconv .ParseInt (* instance .Data .GraphNodes , 10 , 64 )
552553 if err != nil {
553554 response .Diagnostics .AddWarning (
554555 "Error while parsing graph nodes" ,
555556 fmt .Sprintf ("Cannot convert value to int: %s" , * instance .Data .GraphNodes ),
556557 )
557- stateData .GraphNodes = types .Int32Null ()
558+ stateData .GraphNodes = types .Int64Null ()
558559 }
559- stateData .GraphNodes = types .Int32Value ( int32 ( graphNodes ) )
560+ stateData .GraphNodes = types .Int64Value ( graphNodes )
560561 } else {
561- stateData .GraphNodes = types .Int32Null ()
562+ stateData .GraphNodes = types .Int64Null ()
562563 }
563564 if instance .Data .GraphRelationships != nil {
564- graphRelationships , err := strconv .Atoi (* instance .Data .GraphRelationships )
565+ graphRelationships , err := strconv .ParseInt (* instance .Data .GraphRelationships , 10 , 64 )
565566 if err != nil {
566567 response .Diagnostics .AddWarning (
567568 "Error while parsing graph relationships" ,
568569 fmt .Sprintf ("Cannot convert value to int: %s" , * instance .Data .GraphNodes ),
569570 )
570- stateData .GraphRelationships = types .Int32Null ()
571+ stateData .GraphRelationships = types .Int64Null ()
571572 }
572- stateData .GraphRelationships = types .Int32Value ( int32 ( graphRelationships ) )
573+ stateData .GraphRelationships = types .Int64Value ( graphRelationships )
573574 } else {
574- stateData .GraphRelationships = types .Int32Null ()
575+ stateData .GraphRelationships = types .Int64Null ()
575576 }
576577 if instance .Data .SecondariesCount != nil {
577578 stateData .SecondariesCount = types .Int32Value (int32 (* instance .Data .SecondariesCount ))
0 commit comments