我正在使用AWS Lambda方法中的amazondax服务,并得到一个异常,该异常指示缺少权限-但是我不知道为此需要什么权限。 Lambda方法和我的DAX群集都设置有相同的VPC子网和安全组。我收到以下异常:
[ERROR] 2018-12-11T23:06:50.457Z 70c80374-fd99-11e8-bac1-318371e7b8ed Failed to retrieve endpoints
Traceback (most recent call last):
File "/var/task/amazondax/Cluster.py", line 211, in _pull
new_endpoints = self._pull_from(ip, port)
File "/var/task/amazondax/Cluster.py", line 222, in _pull_from
endpoints = client.endpoints()
File "/var/task/amazondax/DaxClient.py", line 192, in endpoints
return self._decode_result('endpoints', None, Assemblers.endpoints_455855874_1, tube)
File "/var/task/amazondax/DaxClient.py", line 227, in _decode_result
return self._handle_error(operation_name, tube)
File "/var/task/amazondax/DaxClient.py", line 233, in _handle_error
raise DaxServiceError(operation_name, message, codes, *exc_info)
amazondax.DaxError.DaxServiceError: An error occurred (Unknown) when calling the endpoints operation: Client does not have permission to invoke Endpoints
我认为最后一行“客户端没有权限...”是解决此问题的关键,但是我在确定所需的权限时遇到了麻烦。
这是破坏代码:
dax = amazondax.AmazonDaxClient(session, region_name='us-east-1', endpoint_url='mydaxcluster.blahblahblah.cache.amazonaws.com:8111')
答案 0 :(得分:3)
您需要为与会话中使用的IAM用户关联的策略添加所需的操作的“ dax:”权限。