AWS ES 使用curl请求失败

  • 问题来源:使用curl工具向ES Endpoint发送请求时提示{"Message":"User: anonymous is not authorized to perform: es:ESHttpPut"}
    • 请求内容如下
    curl -XPUT es_endpoint/domain_name/_doc/1 -d '{"director": "Burton, Tim", "genre": ["Comedy","Sci-Fi"], "year": 1996, "actor": ["Jack Nicholson","Pierce Brosnan","Sarah Jessica Parker"], "title": "Mars Attacks!"}' -H 'Content-Type: application/json'
    
  • 解决方案:在access访问权限中允许当前IP访问,因为curl是直接发送请求的,不会获取到当前登陆的IAM信息
  • 获取当前机器公网IP方法:获取公网IP
  • 参考文献:User: anonymous is not authorized错误解决方案

你可能感兴趣的:(AWS相关)