From 6154e5f3a6b66ea57ac5e2789e3ee55975578e2b Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 8 Feb 2024 21:35:50 -0500 Subject: [PATCH] rds/orderable_instance: Improve performance --- internal/service/rds/orderable_instance_data_source.go | 6 +++--- internal/service/rds/orderable_instance_data_source_test.go | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/internal/service/rds/orderable_instance_data_source.go b/internal/service/rds/orderable_instance_data_source.go index e4c12365c58..5523a67f3b0 100644 --- a/internal/service/rds/orderable_instance_data_source.go +++ b/internal/service/rds/orderable_instance_data_source.go @@ -213,7 +213,9 @@ func dataSourceOrderableInstanceRead(ctx context.Context, d *schema.ResourceData var diags diag.Diagnostics conn := meta.(*conns.AWSClient).RDSConn(ctx) - input := &rds.DescribeOrderableDBInstanceOptionsInput{} + input := &rds.DescribeOrderableDBInstanceOptionsInput{ + MaxRecords: aws.Int64(3412), + } if v, ok := d.GetOk("availability_zone_group"); ok { input.AvailabilityZoneGroup = aws.String(v.(string)) @@ -463,8 +465,6 @@ func dataSourceOrderableInstanceRead(ctx context.Context, d *schema.ResourceData return sdkdiag.AppendErrorf(diags, "no RDS DB Instance Classes match the criteria; try a different search") } - //fmt.Printf("found: %s, %s\n", aws.StringValue(found.DBInstanceClass), aws.StringValue(found.EngineVersion)) - d.SetId(aws.StringValue(found.DBInstanceClass)) d.Set("availability_zone_group", found.AvailabilityZoneGroup) var availabilityZones []string diff --git a/internal/service/rds/orderable_instance_data_source_test.go b/internal/service/rds/orderable_instance_data_source_test.go index 5f878ba6a16..3207a6196b1 100644 --- a/internal/service/rds/orderable_instance_data_source_test.go +++ b/internal/service/rds/orderable_instance_data_source_test.go @@ -242,7 +242,7 @@ func TestAccRDSOrderableInstanceDataSource_readReplicaCapable(t *testing.T) { resource.TestCheckResourceAttr(dataSourceName, "read_replica_capable", "true"), resource.TestCheckResourceAttr(dataSourceName, "engine", tfrds.InstanceEngineOracleEnterprise), resource.TestCheckResourceAttr(dataSourceName, "engine_latest_version", "true"), - resource.TestMatchResourceAttr(dataSourceName, "instance_class", regexache.MustCompile(`^db\..*large$`)), + resource.TestCheckResourceAttrSet(dataSourceName, "instance_class"), ), }, },