-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Ability to provide EventPattern #816
Comments
Why not possible? These should all be supported: http://docs.aws.amazon.com/lambda/latest/dg/invoking-lambda-function.html#supported-event-source-cloudwatch-events Feel free to re-open if not, but I think it is. |
@Miserlou could you show how to define this in Zappa? I could not find this anywhere in the documentation. I ended up modifying the code to get the functionality, but if there is a way to do it I would prefer to do it properly. |
Hm. How was the code modified?
From my phone..
…On May 5, 2017 7:13 PM, "Derek Kulinski" ***@***.***> wrote:
@Miserlou <https://github.com/Miserlou> could you show how to define this
in Zappa? I could not find this anywhere in the documentation.
I ended up modifying the code to get the functionality, but if there is a
way to do it I would prefer to do it properly.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#816 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AAIi06X7nYAubkfv1f7-GYSEra7xIpRGks5r260BgaJpZM4NNrPg>
.
|
Added my changes (it's not suitable to be merged yet) |
@Miserlou as far as I can tell this is not supported by Zappa right now; at least for EC2 events from Cloudwatch Events. I was kind of able to get it working by using the following:
This allows kappa to create/update/delete the event (I believe). However, I had to tweak the zappa code that defines I also had to override the I'm not sure if all that is needed/safe to do in general though, so I'm not ready to make a PR. |
@mjschultz is rigth! Thanks you put me on the rigth track. The CloudWatchEventSource class is using a wrong target name for the lambda function. I made a small change in the class to work around the problem for now.
Just overriding the function.name on the beginning of each method. This is my zappa conf: P.S.: If you have stale configs in cloudwatch rules and lambda triggers about this event, remove that on console first. After that zappa can schedule and unschedule normally using this patch. |
It looks like implementing this through zappa is currently not possible: https://aws.amazon.com/blogs/compute/building-a-dynamic-dns-for-route-53-using-cloudwatch-events-and-lambda/
Particularly equivalent of this command:
aws events put-rule --event-pattern "{\"source\":[\"aws.ec2\"],\"detail-type\":[\"EC2 Instance State-change Notification\"],\"detail\":{\"state\":[\"running\",\"shutting-down\",\"stopped\"]}}" --state ENABLED --name ec2_lambda_ddns_rule
The text was updated successfully, but these errors were encountered: