zappa / Zappa

Serverless Python
https://zappa.ws/zappa
MIT License
3.31k stars 363 forks source link

Deploying a Zappa project invoked using S3 events, reverts any EventBridge configuration for a given S3 bucket #1176

Closed Sam152 closed 6 months ago

Sam152 commented 2 years ago

Context

Expected Behavior

Actual Behavior

Possible Fix

Steps to Reproduce

  1. Create a project with the following configuration:

    "events": [
      {
        "function": "function_name",
        "event_source": {
          "arn": "arn:aws:s3:::BUCKET-NAME",
          "events": [
            "s3:ObjectCreated:*"
          ],
        }
      }
    ]
  2. Enable EventBridge integration for the bucket:

Screen Shot 2022-09-21 at 8 58 53 am
  1. Deploy the Zappa project and observe the integration has been turned off.
monkut commented 2 years ago

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?

Sam152 commented 2 years ago

Not in this case, no. Once the EventBridge integration reflects as "Off" in the UI, events are no longer delivered to EventBridge.

Sam152 commented 2 years ago

Revisiting this, I haven't tested it, but I also wonder if other "Event notifications" would also be removed when deploying a zappa project.

monkut commented 2 years ago

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.

github-actions[bot] commented 6 months ago

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.

github-actions[bot] commented 6 months ago

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.

zilinskas commented 3 weeks ago

This is still an issue