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

feat(subscriber): add subscription diff logic #80

Merged
merged 1 commit into from
Nov 14, 2023
Merged

Conversation

jta
Copy link
Contributor

@jta jta commented Nov 10, 2023

First pass at fleshing out the HandleSubscribe endpoint. This is unlikely to have all the safeguards we need, but for now:

  • we only manage subscription filters which have our filter name as a prefix.
  • if there are already 2 filters, we do nothing

The diffing function is broken out so that we can test it without involving AWS API stubs.

Base automatically changed from joao/handler-config to main November 14, 2023 03:32
Copy link
Contributor

@obs-gh-colinhutchinson obs-gh-colinhutchinson left a comment

Choose a reason for hiding this comment

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

A question for future us: what does uninstalling look like?

A question for now: does an AWS step function make more sense then a full fledged SQS queue?

Edit to add: reading up on step function I don't think they make more sense here vs an sqs queue. Step functions look more relevant when conditional logic or coordination between multiple services is required

@jta
Copy link
Contributor Author

jta commented Nov 14, 2023

A question for future us: what does uninstalling look like?

This is a good question. Past experience suggests that it's tricky to guarantee a clean uninstall, even if you managed to get a clean install, since you may have subscribed to far more log groups over time than were available on first install.

My current approach is that for a quick uninstall, removing the destination ARN is enough. Since the subscriber will be almost always managed alongside the destination (in our case a firehose), deleting the firehose will leaving dangling subscriptions that have no effect.

For a clean uninstall, you can always install the stack with no destination ARN. This will remove any filters which begin with FILTER_NAME.

First pass at fleshing out the `HandleSubscribe` endpoint. This is
unlikely to have all the safeguards we need, but for now:

- we only manage subscription filters which have our filter name as a
  prefix.
- if there are already 2 filters, we do nothing

The diffing function is broken out so that we can test it without
involving AWS API stubs.
@jta jta merged commit c68faae into main Nov 14, 2023
6 checks passed
@jta jta deleted the joao/subscription-filters branch November 14, 2023 21:25
Copy link

🎉 This PR is included in version 1.2.0-beta.1 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

Copy link

🎉 This PR is included in version 1.2.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants