相关疑难解决方法(0)

如何通过NodeJS调用elasticsearch apis?

我的任务是对弹性搜索 api 进行 POST api 调用,

https://search-test-search-fqa4l6ubylznt7is4d5yxlmbxy.us-west-2.es.amazonaws.com/klove-ddb/recipe/_search

我以前没有对 AWS 服务进行 api 调用的任何经验。

所以,我试过这个 -

axios.post('https://search-test-search-fqa4l6ubylznt7is4d5yxlmbxy.us-west-2.es.amazonaws.com/klove-ddb/recipe/_search')
            .then(res => res.data)
            .then(res => console.log(res));
Run Code Online (Sandbox Code Playgroud)

但我收到了 {"Message":"User:anonymous is notauthorized to perform: es:ESHttpPost"}

我还检查了一些 IAM 角色并将 AWSESFullAccess 策略添加到我的配置文件中。

我仍然无法解决任何问题。

请帮我。

amazon-web-services node.js elasticsearch aws-sdk aws-lambda

5
推荐指数
1
解决办法
9288
查看次数