Skip to content
This repository has been archived by the owner on Apr 13, 2023. It is now read-only.

feat: subscriptionReaper #557

Merged
merged 12 commits into from
Feb 14, 2022
Merged

feat: subscriptionReaper #557

merged 12 commits into from
Feb 14, 2022

Conversation

ssvegaraju
Copy link
Contributor

@ssvegaraju ssvegaraju commented Feb 9, 2022

Issue #, if available:

Description of changes:
Added a scheduled lambda that only runs if the flag for Subscriptions is set. Uses persistence.getActiveSubscriptions to filter out active subscriptions and persistence.deleteResource to delete expired ones.

Testing

  • deployed successfully to an AWS account.
  • posted a Subscription resource using Postman
  • ran the subscriptionReaper Lambda from the lambda interface on the AWS Console
  • verified that expected subscription resources appeared from the getActiveSubscriptions call, and were filtered correctly
  • ensured that correct subscription resources were deleted based on end date

  • redeployed on a multi-tenant deployment
  • ensured all operations on subscriptions ran as expected with the same method as above

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@ssvegaraju ssvegaraju requested a review from a team as a code owner February 9, 2022 10:14
@github-actions github-actions bot added the size/m label Feb 9, 2022
src/subscriptions/subscriptionReaper.ts Show resolved Hide resolved
src/subscriptions/subscriptionReaper.ts Outdated Show resolved Hide resolved
src/subscriptions/subscriptionReaper.ts Outdated Show resolved Hide resolved
src/subscriptions/subscriptionReaper.ts Outdated Show resolved Hide resolved
serverless.yaml Show resolved Hide resolved
src/subscriptions/subscriptionReaper.ts Outdated Show resolved Hide resolved
return Promise.all(
subscriptions
.filter((s: Record<string, any>) => {
// if s.end is undefined, new Date(s.end) will throw an error
Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe remove this comment. I don't think an error is thrown here

@ssvegaraju ssvegaraju merged commit 56cf3f8 into feat-subscriptions Feb 14, 2022
@ssvegaraju ssvegaraju deleted the feat-subReaper branch February 14, 2022 17:56
carvantes added a commit that referenced this pull request Mar 7, 2022
* feat: add GSI to Resource DDB Table (#533)

* feat: Add data validation for subscription (#543)

* fix: remove _subsciptionStatus from export result field (#555)

* feat: sns, sqs, dlq for Subscriptions  (#554)

* feat: Rest hook Lambda (#558)

* feat: subscriptionReaper (#557)

* feat: add subscriptionsMatcher Lambda (#559)

* test: Add Subscriptions test infrastructure/helper (#569)

* fix: update unit tests for subscription reaper (#567)

* test: add subscriptions env vars in gh actions (#572)

* fix: encrypt logs for new Lambda fns (#574)

* test: add Subscription reaper tests (#575)

* feat: emit end to end latency metric from rest-hook Lambda (#570)

* test: add tests for tenant isolation of subscriptions (#577)

* feat: add DLQ for matcher Lambda (#576)

* test: add end to end tests for subscriptions (#578)

* perf: partial failures for restHook Lambda (#579)

* docs: add Subscription docs (#582)

Co-authored-by: Sukeerth Vegaraju <ssvegaraju@yahoo.co.in>
Co-authored-by: zheyanyu <zheyanyu@amazon.com>
Co-authored-by: Yanyu Zheng <yz2690@columbia.edu>
Co-authored-by: brndhpkn <98061326+brndhpkn@users.noreply.github.com>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants