"endpoint" configuration parameter is ignored by DynamoDBClient
See original GitHub issueDescribe the bug
Trying to migrate to aws-sdk 3 from aws-sdk 2. We are using endpoint
configuration parameter to have the Dynamo client talk to a local instance of Dynamo for unit tests, but the SDK ignores it, and keeps trying to reach the remote Dynamo, resulting in an error ExpiredToken: The security token included in the request is expired
Your environment
Node 12.20.1, MacOS Catalina
SDK version number
“@aws-sdk/client-dynamodb”: “3.16.0”
Is the issue in the browser/Node.js/ReactNative?
Node.js
Details of the browser/Node.js/ReactNative version
Node 12.20.1
Steps to reproduce
const {DynamoDBClient, BatchWriteItemCommand} = require('@aws-sdk/client-dynamodb');
const {marshall} = require('@aws-sdk/util-dynamodb');
(async () => {
const dynamoClient = new DynamoDBClient({endpoint: "http://localhost:2348"});
const ids = ['1232'];
const params = {
RequestItems: {
'mytable': ids.map((id) => {
return {
DeleteRequest: {
Key: marshall({id}),
},
};
}),
},
};
const command = new BatchWriteItemCommand(params);
await dynamoClient.send(command);
})().catch(e => {
console.log(e, 'error');
})
Observed behavior
AWS SDK client tries to send requests to real Dynamo AWS.
Expected behavior
AWS SDK client should be sending requests to local Dynamo instance.
Issue Analytics
- State:
- Created 2 years ago
- Reactions:14
- Comments:9 (2 by maintainers)
Top Results From Across the Web
Configuration for the AWS SDK for PHP Version 3
If a service does not support endpoint discovery this configuration is ignored. Aws\EndpointDiscovery\ConfigurationInterface. An optional configuration ...
Read more >DynamoDbDataStoreBuilder (launchdarkly-java-server-sdk ...
The AWS SDK provides many configuration options for a DynamoDB client. ... Parameters: endpointUri - the custom endpoint URI; Returns: the builder ...
Read more >Amazon DynamoDB Client :: Quarkiverse Documentation
If you're going to use a local DynamoDB instance, configure it as follows: quarkus.dynamodb.endpoint-override=http://localhost:4566 ...
Read more >Amazon DynamoDB Sink Connector Configuration Properties
DynamoDB Parameters¶. aws.dynamodb.max.retry.time.seconds. The maximum time up to which the DynamoDB client will try writing records.
Read more >How to run DynamoDB Local and Offline - Complete Guide
If you want to connect to this container using SDK or CLI, don't forget to change the endpoint parameter in the configuration.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@frannav ah, I remember – it was an issue related to nestjs dependency injection. I’ve misconfigured it and it would create an
SNSClient
instance without passing the config object in there.Revisiting during review meeting. The action item would be to check if endpoint which contains localhost is overridden in any middleware.