我正在使用 DAX 服务连接到 AWS dynamodb。从 DAX 查询数据时,我没有遇到任何问题,并且能够获取数据。但是当我尝试使用 DAX 将新项目插入 DynameDB 时,我遇到了错误。
An error occurred(Unknown) when calling the defineAttributeListId operation: Client does not have permission to invoke DefineAttributeListId.
代码:
import amazondax
def put_movie(title, year, plot, rating):
with amazondax.AmazonDaxClient.resource(endpoint_url="http://localhost:8000") as dax
table = dynamodb.Table('Movies')
response = table.put_item(
Item={
'year': year,
'title': title,
'info': {
'plot': plot,
'rating': rating
}
}
)
return response
if __name__ == '__main__':
movie_resp = put_movie("The Big New Movie", 2015,
"Nothing happens at all.", 0)