- Newest
- Most votes
- Most comments
Can client reuse cause SignatureExpired?
No. The DynamoDB client does not cache signing timestamps. Each request generates a fresh timestamp at signing time. The SignatureExpired error occurs when the signed timestamp deviates >15 minutes from the server clock, this is a clock skew issue, not a client state issue.
Does the SDK cache signing state that goes stale?
No signing timestamp is cached. The SDK does cache credentials (STS tokens), but credential staleness produces ExpiredTokenException, not SignatureExpired. These are distinct errors.
Root cause of your intermittent SignatureExpired
The most likely culprit: the Lambda execution environment's system clock drifted significantly while the environment was frozen/idle, then resumed with a skewed clock. AWS Lambda freezes the execution environment between invocations, in rare cases, after a very long idle period, the resumed environment can briefly have a stale clock before the hypervisor syncs it. This is an infrastructure-level edge case, not SDK behavior.
Should you create a new client per invocation?
No, this is the wrong mitigation and introduces real costs:
- TLS handshake overhead on every invocation (~50-100ms)
- Connection pool churn
- Higher memory pressure from repeated client instantiation
Recommended approach
Add retry logic specifically for SignatureExpired with a short delay, the clock corrects itself within seconds:
// Retry config handles the rare clock skew case const client = new DynamoDBClient({ region: AWS_REGION, maxAttempts: 3, });
Initialize once outside the handler. The SDK's built-in retry behavior does not retry SignatureExpired by default (it's treated as a client error), so you may want to implement a custom retry for this specific error code if frequency warrants it.
Bottom line: The error is caused by Lambda environment clock skew, not client reuse. Creating a new client per invocation will not fix it and degrades performance.
Relevant content
asked 3 years ago
asked a year ago
asked 18 days ago
- AWS OFFICIALUpdated 2 years ago
- AWS OFFICIALUpdated 2 years ago
- AWS OFFICIALUpdated 2 months ago

Hi Leeroy,
Yeah, I was considering implementing a retry specifically for the
SignatureExpirederror. However, it would require a fairly large code change in our current project. Before going down that path, I wanted to understand whether creating a new DynamoDB client instance per invocation could potentially resolve the issue.Do you think retrying is the only practical solution for this, or is there any other approach you'd recommend? Also, have you come across this issue before in Lambda or with the DynamoDB SDK?
Its not really related directly to the DynamoDB SDK, something is causing Lambda time to offset, resulting in SIgnatureExpired exceptions. This can sometimes happen if you create a promise in your initialization code but don't await it until your handler is executed. Your code is paused after initialization completes until the handler is executed. You can use top-level await to fix it so that promises complete within your initialization code. Examples can be seen here: https://aws.amazon.com/blogs/compute/using-node-js-es-modules-and-top-level-await-in-aws-lambda/
Thanks, that's helpful. I don't think we're creating any async promises during initialization that are awaited later.
If you know of any other scenarios that could lead to intermittent SignatureExpired errors in Lambda, I'd be interested to hear about them.