浏览器客户端可以连接到doxker容器中的dynamodb

发布于 2025-02-06 20:58:30 字数 471 浏览 0 评论 0原文

我一直在使用@aws-sdk/client-dynamodb server-side(sveltekit/nodejs)连接到Localhost docker容器,并使用Amazon/dynamodb-local的实例:最新效果很好。我使用AWS CLI配置表等

  const client = new DynamoDBClient({ endpoint: 'http://localhost:8000' });

。 。我已经尝试通过区域:'none',但是后来我收到了一条消息,说凭证丢失了。添加虚拟凭据使命令可以执行,但我没有得到预期的响应。例如,发送listTablesCommand返回一个空数组。如果我从AWS CLI中做同样的事情,我会得到正确的响应。

DynamoDB客户端是否在浏览器中运行客户端?还是我想念其他东西?

I've been using @aws-sdk/client-dynamodb server-side (SvelteKit / NodeJS) connecting to localhost Docker container with instance of amazon/dynamodb-local:latest which works well. I used AWS CLI to configure tables, etc. I've created the client using the simplest configuration:

  const client = new DynamoDBClient({ endpoint: 'http://localhost:8000' });

This works server-side, but when the same is executed client-side along with a command, I get a message that the region is missing. I've tried passing region: 'none', but then I get a message that the credentials are missing. Adding dummy credentials enables the command to execute, but I don't get an expected response. For example, sending the ListTablesCommand returns an empty array. If I do the same from the AWS CLI, I get the correct response.

Does the DynamoDB client run client-side, i.e., in the browser? Or am I missing something else?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

棒棒糖 2025-02-13 20:58:30

不,它不会在浏览器中运行,您将需要API网关和一些后端代码将浏览器连接到DynamoDB。

No it doesn't run in a browser, You will need API Gateway and some backend code to connect a browser to Dynamodb.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文