fix(dynamodb): properly handle ResourceInUseException for existing tables (#2909)

Signed-off-by: Andrei Aaron <aaaron@luxoft.com>
This commit is contained in:
Andrei Aaron
2025-01-25 00:58:13 +02:00
committed by GitHub
parent ececc9c2c9
commit cf8b20d92d
+7 -4
View File
@@ -2132,9 +2132,11 @@ func (dwr *DynamoDB) createTable(tableName string) error {
},
BillingMode: types.BillingModePayPerRequest,
})
if err != nil && !strings.Contains(err.Error(), "Table already exists") {
return err
if err != nil {
inUseException := new(types.ResourceInUseException)
if !errors.As(err, &inUseException) {
return err
}
}
return dwr.waitTableToBeCreated(tableName)
@@ -2190,7 +2192,8 @@ func (dwr *DynamoDB) createVersionTable() error {
BillingMode: types.BillingModePayPerRequest,
})
if err != nil {
if strings.Contains(err.Error(), "Table already exists") {
inUseException := new(types.ResourceInUseException)
if errors.As(err, &inUseException) {
return nil
}