Zappa
Zappa copied to clipboard
Deploying a Zappa project invoked using S3 events, reverts any EventBridge configuration for a given S3 bucket
Context
- I've deployed a zappa project which is invoked by an S3 event. When it's deployed, it creates a record under the "Event notifications" section of the S3 bucket.
- I've previously configured (via CDK) that the bucket should "Send notifications to Amazon EventBridge for all events in this bucket".
Expected Behavior
- Deploying the project should retain the existing EventBridge configuration.
Actual Behavior
- When the Zappa lambda is deployed, the EventBridge configuration is reverted to "Off".
Possible Fix
Steps to Reproduce
- Create a project with the following configuration:
"events": [
{
"function": "function_name",
"event_source": {
"arn": "arn:aws:s3:::BUCKET-NAME",
"events": [
"s3:ObjectCreated:*"
],
}
}
]
- Enable EventBridge integration for the bucket:
- Deploy the Zappa project and observe the integration has been turned off.
Here's the related code where zappa schedules events: https://github.com/zappa/Zappa/blob/master/zappa/core.py#L2775
zappa uses kappa to update the s3 event source.
I suspect the unschedule remove() action may be removing the notification configuration.
However, I wonder if this is just a cosmetic issue on aws's side.
I have seen issues with triggers defined by zappa or cfn files that don't show in the console, but function as expected.
Do S3 notifications still work with the target bucket?
Not in this case, no. Once the EventBridge integration reflects as "Off" in the UI, events are no longer delivered to EventBridge.
Revisiting this, I haven't tested it, but I also wonder if other "Event notifications" would also be removed when deploying a zappa project.
The easiest workaround we could implement in zappa is to provide a flag to ignore redeploying events.
In your case, I would use zappa for packaging and separate deployment.
I'd like to see a point where zappa has a more clearly separated deployment/packaging integration, where zappa generates the cloudformation templates that you could edit if necessary, then the zappa deployment commands just wrap the related cloudformation calls.
Hi there! Unfortunately, this Issue has not seen any activity for at least 90 days. If the Issue is still relevant to the latest version of Zappa, please comment within the next 10 days if you wish to keep it open. Otherwise, it will be automatically closed.
Hi there! Unfortunately, this Issue was automatically closed as it had not seen any activity in at least 100 days. If the Issue is still relevant to the latest version of Zappa, please open a new Issue.