jorgebastida / gordon

λ Gordon is a tool to create, wire and deploy AWS Lambdas using CloudFormation
Other
2.05k stars 137 forks source link

No trigger from s3:ObjectCreated:* #16

Open bomatson opened 8 years ago

bomatson commented 8 years ago

Hi there! Thanks for creating this awesome tool.

I was trying to test it out by having a lambda function respond to an object being created in an existing S3 bucket test-bucket. However, adding a file to that bucket is not triggering the function, nor am I seeing any addition to the event sources for that lambda function in the AWS console. In my project settings.yml:


---
project: test
default-region: us-east-1
code-bucket: gordon-test-326a588b
apps:
  - gordon.contrib.helpers
  - gordon.contrib.lambdas
  - gordon.contrib.s3
  - scouting_locations

s3:
  scouting_s3_integration:
    bucket: arn:aws:s3:::test-bucket
    notifications:
      on_create:
        lambda: scouting_locations.helloworld
        events:
          - s3:ObjectCreated:*

I'm able to test the lambda function successfully in the AWS console, just not when the test bucket changes. Did I miss a step?

juanriaza commented 8 years ago

Might be related to https://github.com/jorgebastida/gordon/pull/10

ausmith commented 8 years ago

If "an existing S3 bucket test-bucket" is true, then I don't believe #10 is the cause here and something else is going on. If he does not already have this bucket though, the bucket name of test-bucket is likely already taken.

bomatson commented 8 years ago

Yup, this is an existing bucket @ausmith

jorgebastida commented 8 years ago

@bomatson Your configuration looks good to me. Could you please check you have selected the current alias of you lambda, and not the $LATEST? This is a common mistake.

For AWS the $LATEST and the current are two different entities which don't share metrics or event sources event if they are actually the same "version".

captura de pantalla 2016-06-02 23 22 34
bomatson commented 8 years ago

@jorgebastida Makes sense, but it looks like neither $LATEST nor current have event sources:

screenshot 2016-06-03 10 31 25

screenshot 2016-06-03 10 30 43

In fact, it also seems that as I continue deploying, current stays at version 1. Is this intentional? Seems like a separate issue altogether if it's not intentional.

screenshot 2016-06-03 10 30 51

jorgebastida commented 8 years ago

Hello @bomatson this is actually quite weird indeed. Did you managed to solve the problem? Yes current label must move forward when you deploy new code (if you do it trough gordon), did you change your lambda using the web ui?

Could you please paste here your main settings configuration?

spullara commented 8 years ago

When I use the gordon tool to build && apply it doesn't move the current pointer to the latest version. Took me a while to figure out that it was because I was only changing the configuration of the handler name (correcting a spelling mistake) but if I update the code, it moves it.