mirror of
https://github.com/floci-io/floci.git
synced 2026-11-22 21:50:46 -05:00
fix(rds): fault with DBInstanceNotFound/DBClusterNotFoundFault for missing identifiers in Describe* (#1740)
* fix(rds): fault with DBInstanceNotFound/DBClusterNotFoundFault for missing identifiers in Describe* DescribeDBInstances/DescribeDBClusters returned an empty 200 when the identifier parameter matched nothing; real AWS faults for the parameter form and returns an empty list only for the Filters form. Track whether the identifier came from the parameter and fault when it matched nothing, with error codes, messages, and 404 status matching live AWS. * fix(rds,docdb,neptune): ARN identifiers and Filters-form parity for Describe* Review follow-ups: - RDS, DocDB, and Neptune list methods accept an ARN (the identifier parameter and the db-instance-id/db-cluster-id filters both allow ARNs per the AWS model). The ARN is matched against each resource's stored ARN, so a cross-account or cross-region ARN does not resolve a same-named local resource. - DocDbQueryHandler and NeptuneQueryHandler fault only for the identifier parameter, not the Filters form, which returns an empty list (mirror of the RDS fix). * test(rds): expect NotFound faults after delete in SDK compat tests The Go and Java compat suites asserted the old emulator behavior — an empty 200 when describing a deleted instance/cluster by identifier. Real AWS faults DBInstanceNotFound/DBClusterNotFoundFault there, which is what the deletion waiters key on, and the emulator now does the same.
This commit is contained in:
1 parent
d943e09a73
commit
02288abc11
14 files changed
+357
-34
No files matched your search
+8
-5
@@ -15,9 +15,9 @@ import software.amazon.awssdk.services.rds.RdsClient;
|
||||
import software.amazon.awssdk.services.rds.model.CreateDbInstanceRequest;
|
||||
import software.amazon.awssdk.services.rds.model.CreateDbInstanceResponse;
|
||||
import software.amazon.awssdk.services.rds.model.DBInstance;
|
||||
import software.amazon.awssdk.services.rds.model.DbInstanceNotFoundException;
|
||||
import software.amazon.awssdk.services.rds.model.DeleteDbInstanceRequest;
|
||||
import software.amazon.awssdk.services.rds.model.DescribeDbInstancesRequest;
|
||||
import software.amazon.awssdk.services.rds.model.DescribeDbInstancesResponse;
|
||||
import software.amazon.awssdk.services.rds.model.GenerateAuthenticationTokenRequest;
|
||||
import software.amazon.awssdk.services.rds.model.ModifyDbInstanceRequest;
|
||||
|
||||
@@ -306,10 +306,13 @@ class RdsJdbcCompatTest {
|
||||
.build());
|
||||
instanceCreated = false;
|
||||
|
||||
DescribeDbInstancesResponse afterDelete = rds.describeDBInstances(DescribeDbInstancesRequest.builder()
|
||||
.dbInstanceIdentifier(instanceId)
|
||||
.build());
|
||||
assertThat(afterDelete.dbInstances()).isEmpty();
|
||||
// Real AWS faults DBInstanceNotFound when describing a deleted instance by
|
||||
// identifier — this is what lets the DBInstanceDeleted waiter complete.
|
||||
String deletedId = instanceId;
|
||||
assertThatThrownBy(() -> rds.describeDBInstances(DescribeDbInstancesRequest.builder()
|
||||
.dbInstanceIdentifier(deletedId)
|
||||
.build()))
|
||||
.isInstanceOf(DbInstanceNotFoundException.class);
|
||||
|
||||
String replacementId = TestFixtures.uniqueName("rds-pg");
|
||||
CreateDbInstanceResponse replacement = rds.createDBInstance(CreateDbInstanceRequest.builder()
|
||||
|
||||
Reference in new issue
Block a user