Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 7 additions & 5 deletions packages/idempotency/src/persistence/DynamoDBPersistenceLayer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -81,15 +81,17 @@ class DynamoDBPersistenceLayer extends BasePersistenceLayer {
this.staticPkValue =
config.staticPkValue ?? `idempotency#${this.idempotencyKeyPrefix}`;

this.client = new DynamoDBClient(config?.clientConfig ?? {});
if (config?.awsSdkV3Client) {
if (isSdkClient(config.awsSdkV3Client)) {
this.client = config.awsSdkV3Client;
} else {
if (config.awsSdkV3Client) {
if (!isSdkClient(config.awsSdkV3Client)) {
console.warn(
'awsSdkV3Client is not an AWS SDK v3 client, using default client'
);
this.client = new DynamoDBClient(config.clientConfig ?? {});
} else {
this.client = config.awsSdkV3Client;
}
} else {
this.client = new DynamoDBClient(config.clientConfig ?? {});
}
addUserAgentMiddleware(this.client, 'idempotency');
}
Expand Down