【发布时间】:2021-11-24 20:17:20
【问题描述】:
我正在尝试编写一个 lambda 来从 OpenSearach 域获取数据。
const { Client } = require('@opensearch-project/opensearch');
const { createAWSConnection, awsGetCredentials } = require('@acuris/aws-es-connection');
const test = async () => {
const awsCredentials = await awsGetCredentials();
const AWSConnection = createAWSConnection(awsCredentials);
const client = new Client({
...AWSConnection,
node: 'https://<domain-name>.us-east-2.es.amazonaws.com'
});
// inside async func
await client.cat.help();
};
test();
错误:
(node:32926) ProductNotSupportedSecurityError: The client is unable to verify that the server is Elasticsearch due to security privileges on the server-side. Some functionality may not be compatible if the server is running an unsupported product.
【问题讨论】:
-
你找到解决办法了吗?
-
我还没有测试任何答案,目前正在使用 rest apis...
-
好的。您是否尝试在 AWS 上创建用户并将该用户添加到具有 aws elasticsearch 访问策略的组?这是使用正确的凭据。
-
如果您使用细粒度的访问控制,您可以参考这个博客:antstack.io/blog/getting-started-with-open-search 或者对于常规访问是的,IAM 权限可以工作,
标签: amazon-web-services elasticsearch opensearch