调用 amazondax 服务时获取权限异常

Getting permissions exception when calling amazondax service

我正在使用 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

我认为最后一行 "Client does not have permission..." 是关键,但我无法确定需要哪些权限。

这是破坏的代码:

dax = amazondax.AmazonDaxClient(session, region_name='us-east-1', endpoint_url='mydaxcluster.blahblahblah.cache.amazonaws.com:8111')

您需要为与会话中使用的 IAM 用户关联的策略添加您需要的操作的 "dax:" 权限。