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

Support: EventBridgeConfiguration for S3.Client.put_bucket_notification_configuration request parameter #6790

Closed
tsugumi-sys opened this issue Sep 8, 2023 · 3 comments · Fixed by #7252

Comments

@tsugumi-sys
Copy link
Contributor

According to boto3 document, we can support EventBridgeConfiguration for put_bucket_notification_configuration request.

image

https://boto3.amazonaws.com/v1/documentation/api/latest/reference/services/s3/client/put_bucket_notification_configuration.html

However, moto does not support this. How about supporting EventBridge notifications?

moto/moto/s3/models.py

Lines 1248 to 1269 in ca9d8fc

def set_notification_configuration(
self, notification_config: Optional[Dict[str, Any]]
) -> None:
if not notification_config:
self.notification_configuration = None
return
self.notification_configuration = NotificationConfiguration(
topic=notification_config.get("TopicConfiguration"),
queue=notification_config.get("QueueConfiguration"),
cloud_function=notification_config.get("CloudFunctionConfiguration"),
)
# Validate that the region is correct:
for thing in ["topic", "queue", "cloud_function"]:
for t in getattr(self.notification_configuration, thing):
region = t.arn.split(":")[3]
if region != self.region_name:
raise InvalidNotificationDestination()
# Send test events so the user can verify these notifications were set correctly
notifications.send_test_event(account_id=self.account_id, bucket=self)

@bblommers
Copy link
Collaborator

Makes sense @tsugumi-sys.

Do you need to actually send the notifications to EventBridge as well? Then we'll also have to extend the send_event-method:

def send_event(account_id: str, event_name: str, bucket: Any, key: Any) -> None:

@tsugumi-sys
Copy link
Contributor Author

Do you need to actually send the notifications to EventBridge as well? Then we'll also have to extend the send_event-method:

Actually sending the notifications to EventBridge is also needed for this issue :)
So I want to try it here!

@tsugumi-sys
Copy link
Contributor Author

@bblommers
I haven't committed for a while, but I've started trying on this task again.

@bblommers bblommers linked a pull request Feb 15, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants