0
votes

I am trying to set up SQS events' trigger for my serverless python's flask app. Once I try to deploy using Zappa it will give me this message:

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

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

Here is the relevant information in my 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": [
  ...
]
}

I already created my SQS's queue with the right name and copied its ARN, then I followed the format documented in the issue and this PR to configure my zappa_settings.json

1
What version of Zappa are you using? Is it possible you've got an old version from before the SQS support was added?Matt Healy
@MattHealy that is exactly what happened, been a while since I last updated Zappa, What is the minimum required version of Zappa for this feature?gerosalesc
Looks like you need 0.47.0 according to github.com/Miserlou/Zappa/blob/master/CHANGELOG.md#0470Matt Healy

1 Answers

0
votes

You need, at a minimum, version 0.47.0 of Zappa to use SQS as event sources:

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