Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SQS event source fails with 'StartingPosition is not valid for SQS event sources' #466

Closed
mleiseca opened this issue Oct 22, 2018 · 2 comments · Fixed by #467
Closed

SQS event source fails with 'StartingPosition is not valid for SQS event sources' #466

mleiseca opened this issue Oct 22, 2018 · 2 comments · Fixed by #467

Comments

@mleiseca
Copy link

mleiseca commented Oct 22, 2018

I'd like to use an SQS queue as an event source, but there's a default value being provided for 'StartingPosition'. StartingPosition is not a valid value for SQS events.

Would it work to change this line to only provide a default 'StartingPosition' if EventSourceArn doesn't start with 'arn:aws:sqs'?

Here's the eventSources.json that I'm using (with queue names changed)

{
  "EventSourceMappings": [
    {
      "EventSourceArn": "arn:aws:sqs:us-east-1:sqs-queuename1",
      "BatchSize": 1,
      "Enabled": true
    },
    {
      "EventSourceArn": "arn:aws:sqs:us-east-1:sqs-queuename2",
      "BatchSize": 1,
      "Enabled": true
    }
  ]
}

The error message:

{ InvalidParameterValueException: StartingPosition is not valid for SQS event sources.
    at Object.extractError (/usr/lib/node_modules/node-lambda/node_modules/aws-sdk/lib/protocol/json.js:48:27)
    at Request.extractError (/usr/lib/node_modules/node-lambda/node_modules/aws-sdk/lib/protocol/rest_json.js:52:8)
    at Request.callListeners (/usr/lib/node_modules/node-lambda/node_modules/aws-sdk/lib/sequential_executor.js:106:20)
    at Request.emit (/usr/lib/node_modules/node-lambda/node_modules/aws-sdk/lib/sequential_executor.js:78:10)
    at Request.emit (/usr/lib/node_modules/node-lambda/node_modules/aws-sdk/lib/request.js:683:14)
    at Request.transition (/usr/lib/node_modules/node-lambda/node_modules/aws-sdk/lib/request.js:22:10)
    at AcceptorStateMachine.runTo (/usr/lib/node_modules/node-lambda/node_modules/aws-sdk/lib/state_machine.js:14:12)
    at /usr/lib/node_modules/node-lambda/node_modules/aws-sdk/lib/state_machine.js:26:10
    at Request.<anonymous> (/usr/lib/node_modules/node-lambda/node_modules/aws-sdk/lib/request.js:38:9)
    at Request.<anonymous> (/usr/lib/node_modules/node-lambda/node_modules/aws-sdk/lib/request.js:685:12)
  message: 'StartingPosition is not valid for SQS event sources.',
@abetomo
Copy link
Contributor

abetomo commented Oct 23, 2018

Thank you for the report.
SQS event was unsupported.
I'll fix it.

@mleiseca
Copy link
Author

Thanks for the quick response! I've made that change locally and deploying SQS event sources works when it's in place.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants