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

bucket notifications - facilitate notif conf to override connection #8932

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

alphaprinz
Copy link
Contributor

Describe the Problem

We want to allow user to describe an external server in a single connection file, but allow to specify spec per notification configuration.
Specifically, this will allow to have a single connection file for a single external Kafka server, but allow each notification to have it's own Kafka topic.

Explain the Changes

Each notification can have an "override" object that will take precedence over data from connection file.
The "effective" connect file is the original connect file merged (ie, overridden) with the override object.

Issues: Fixed #xxx / Gap #xxx

Testing Instructions:

  1. Create a connection file for kafka (with or without topic field).
    {
    "notification_protocol": "kafka",
    "name": "k",
    "topic": "mytopic",
    "kafka_options_object": "{"metadata.broker.list":"localhost:9092"}"
    }

  2. Configure a notification with override object:
    {
    "TopicConfigurations": [
    {
    "Id": "first",
    "TopicArn": "k?{"topic":"override"}",
    "Events": []
    }
    ]
    }

  3. Create an event (ie upload object to bucket with notification). The notification will be sent with topic "override".

  • Doc added/updated - TBD
  • Tests added

@alphaprinz alphaprinz requested a review from guymguym April 3, 2025 03:19
@alphaprinz alphaprinz force-pushed the notif_kafka_connect2 branch 2 times, most recently from 391fe76 to b32378a Compare April 3, 2025 05:39
Copy link
Member

@guymguym guymguym left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should follow the arn structure format, see comments posted above.

Comment on lines 191 to 193
const filename_parts = connect_filename_with_overrides.split('?');
const connect_filename_no_overrides = filename_parts[0];
const overrides_str = filename_parts[1];
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this ad hoc arn structure is not a good idea, we should try to map it to an arn format.

For kafka I expect the kafka arn format like in aws where ClusterName is our connection name, ClusterUuid should match the kafka cluster uuid , and TopicName would be optional:

arn:aws:kafka:::cluster/${ClusterName}/${ClusterUuid}
arn:aws:kafka:::topic/${ClusterName}/${ClusterUuid}/${TopicName}

For http webhook there is no matching arn in aws, however there is api-gateway or lambda. I would go with something in the spirit of api-gateway execute-api arn where ApiId is our connection name, Stage is less relevant as we do not manage the webhook lifecycle but I would still keep it as part of the arn structure, and finally method and path are very relevant:

arn:aws:execute-api:::${ApiId}/${Stage}/${Method}/${ApiSpecificResourcePath}

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've made the topic for kafka to optionally be "kafka:::topic".
Still haven't found any mention of cluster UUID in the client.
Note that using '/' separator in containerized is somewhat confusing because I also need secret name in addition to connection name (currently, at least).

@alphaprinz alphaprinz force-pushed the notif_kafka_connect2 branch from b32378a to 5d5ee14 Compare April 10, 2025 18:08
@pull-request-size pull-request-size bot added size/S and removed size/M labels Apr 10, 2025
@alphaprinz alphaprinz requested a review from guymguym April 10, 2025 21:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants