I have started using the new AWS Version 3 sdk for some of my services. Unfortunately it is not always clear how to use some features in the modular version 3 code that are available in the Version 2 sdk.
To set timeouts for the non-modular sdk, you can do the following:
AWS.config.update({
httpOptions: {
connectTimeout: 10000,
timeout: 10000
}
});
However, when I want to use the Version 3 sdk and use the Dynamo client, I am explicitly trying not to use the global AWS object. As far as I can tell the configuration input to DynamoDBClient does not accept httpOptions, which is where a timeout would normally get set.
import { DynamoDBClient } from "@aws-sdk/client-dynamodb";
const REGION = process.env.AWS_REGION;
const v3DynamoClient: DynamoDBClient = new DynamoDBClient({ region: REGION });
How do I set a timeout for the DynamoDBClient in the AWS V3 sdk?