Serverless triggered with SQS not send the output to configured destination

Viewed 246

I am using a serverless framework, with a triggering function hello with SQS and this is done correctly with the following config.

functions:
  hello:
    handler: handler.hello
    events:
    # Provide the ARN of your queue
      - sqs: arn:aws:sqs:us-east-1:abc:sqs_input

after adding the destination to the config

destinations:
  onSuccess: arn:aws:sqs:us-east-1:abc:sqs_output
  onFailure: arn:aws:sqs:us-east-1:abc:sqs_output

it works fine only if I call it from AWS CLI with adding --invocation-type Event parameter

aws lambda invoke --function-name testdestination-dev-hello --invocation-type Event response.json

but in my case, the input will be triggered by input SQS and I can not add the --invocation-type Event option, so How can I always active the SQS destination?

1 Answers
Related