You are already setting connectTimeout: 10000 in your KinesisClient. This seems fine, but it's possible that your function needs more time to establish the connection, especially under high load or poor network conditions.
Increase timeout settings: You can try increasing the timeout value to see if it helps. Retry logic: AWS SDK automatically retries on failures, but you can add more robust retry logic or backoff strategies. Example of adjusting httpOptions for a longer timeout:
js Copy code export const KINESIS_CLIENT = new KinesisClient({ region: 'us-west-2', maxRetries: 3, // More retries in case of failure httpOptions: { connectTimeout: 20000, // Increase to 20 seconds timeout: 30000, // Increase overall request timeout }, });