我的任务是对弹性搜索 api 进行 POST api 调用,
我以前没有对 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