I am trying to write a lambda to get data from OpenSearach domain.
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();
Error:
(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.