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

Add known issue for duplicate trigger to ScheduleEvents section #280

Merged
merged 1 commit into from
May 16, 2017

Conversation

EnriqueCanals
Copy link
Contributor

I have done some digging into what could possibly be causing this issue, but to no avail. It seems as though the ResourceConflictException error that is expected if a resource already exists doesn't get returned when the previously created resource is one that was created via the Lambda console for ScheduleEvent triggers- see this line in schedule_events.js to see where this error is expected to be present for existing resources.

So, if the trigger you're trying to add to the Lambda is already there because it was added manually via the Lambda UI/console, including it via the eventSourceFile will result in a duplicate trigger being added since the Lambda SDK interprets those as separate resources for some reason (even though the SourceArn is identical).

I can try to work on a fix for this later this week/weekend, but for now I figured including it in the docs might be useful if anyone out there is experiencing this issue.

If you'd like to recreate the issue for yourself, try the following:

  • In the trigger section for a Lambda- click on Add Trigger
  • In the next prompt, select CloudWatch Events - Schedule
  • Next, select the rule you want and Submit.
    • You should now see a CloudWatch Event trigger for your function in the console
  • Next, include the same event rule in your eventSourceFile and deploy.
  • Finally, return to the triggers section in the Lambda console and you will see 2 identical triggers for your lambda.

@abetomo
Copy link
Contributor

abetomo commented May 16, 2017

Thank you.

Schedule events are managed by StatementId. (https://github.com/motdotla/node-lambda/blob/master/lib/schedule_events.js#L53)
Duplicate checks are made accordingly.

I think that two events are registered because the numbering rule of node-lambda is different from that of the web console.

It seems difficult to check the duplication with the event created from the web console from the prepared API.

When operating with node-lambda it may be better to note the content that you should refrain from using the web console.

@DeviaVir DeviaVir merged commit ca9ed8f into motdotla:master May 16, 2017
@DeviaVir DeviaVir mentioned this pull request Jun 16, 2017
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 this pull request may close these issues.

3 participants