0

我正在尝试为我的无服务器 python 烧瓶应用程序设置 SQS 事件触发器。一旦我尝试使用Zappa进行部署,它会给我以下消息:

Oh no! An error occurred! :(

==============

Traceback (most recent call last):
  ...
  File "...\venv\lib\site-packages\zappa\core.py", line 2613, in unschedule_events
    self.boto_session
  File "...\venv\lib\site-packages\zappa\utilities.py", line 317, in remove_event_source
    event_source_obj, ctx, funk = get_event_source(event_source, lambda_arn, target_function, boto_session, dry=False)
  File "...\venv\lib\site-packages\zappa\utilities.py", line 256, in get_event_source
    raise ValueError('Unknown event source: {0}'.format(arn))
ValueError: Unknown event source: arn:aws:sqs:MY_QUEUE

==============

这是我的zappa_settings.json中的相关信息

"dev_events": {
"debug": true,
"log_level": "DEBUG",
"app_function": "application.app",
"aws_region": ...,
"profile_name": "default",
"project_name": ..,
"runtime": "python3.6",
"s3_bucket": ...,
"timeout_seconds": 30,
"keep_warm": false,
"keep_warm_expression": "rate(5 minutes)",
"memory_size": 256,
"manage_roles": true,
"use_precompiled_packages": true,
"environment_variables": {
  ...
},
"aws_environment_variables ": {
  ...
},
"events": [
  {
    "function": "application.process_simulation_paths_queue",
    "event_source": {
      "arn": "arn:aws:sqs:MY_QUEUE",
      "batch_size": 10,
      "enabled": true
    }
  }
],
"exclude": [
  ...
]
}

我已经用正确的名称创建了我的 SQS 队列并复制了它的 ARN,然后我按照问题和这个PR中记录的格式来配置我的zappa_settings.json

4

1 回答 1

0

您至少需要 0.47.0 版的 Zappa 才能使用 SQS 作为事件源:

https://github.com/Miserlou/Zappa/blob/master/CHANGELOG.md#0470

于 2018-11-21T23:21:10.347 回答