调用amazondax服务时获取权限异常 [英] Getting permissions exception when calling amazondax service

查看:183
本文介绍了调用amazondax服务时获取权限异常的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用AWS Lambda方法中的amazondax服务,并得到一个异常,该异常指示缺少权限-但是我不知道为此需要什么权限. Lambda方法和我的DAX群集都设置有相同的VPC子网和安全组.我收到以下异常:

I'm using the amazondax service from an AWS Lambda method, and getting an exception that indicates missing permissions - but I don't know what permissions are necessary for this. Both the Lambda method and my DAX cluster are setup with the same VPC subnets and security groups. I'm getting the following exception:

[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

我认为最后一行客户端没有权限..."是解决此问题的关键,但是我在确定所需的权限时遇到了麻烦.

I assume the last line "Client does not have permission..." is the key to this, but I'm having trouble figuring out exactly what permission(s) are required.

这是破坏代码:

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

推荐答案

您将需要对与会话中使用的IAM用户关联的策略添加"dax:"权限,以执行所需的操作.

You will need to add "dax:" permissions for the operations you need to the policy associated with the IAM user used in the session.

这篇关于调用amazondax服务时获取权限异常的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆