【发布时间】:2019-12-27 01:51:23
【问题描述】:
我正在尝试使用 lambda 从 dynamoDB 的表中获取内容,但是,我收到了 thsi 错误,请帮助。
def lambda_handler(event, context):
response = table.get_item(
Key={
'id' : event.id
}
)
"errorMessage": "'dict' object has no attribute 'id'",
【问题讨论】:
-
你确定
event有一个id? -
是的,我正在通过测试活动。 { "id": "12345" } 我在 DB 中创建了一个表,主键为 id。
标签: python amazon-web-services aws-lambda amazon-dynamodb