-
-
Notifications
You must be signed in to change notification settings - Fork 4.2k
Events: add classmethod to recreate services #12566
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
Conversation
LocalStack Community integration with Pro 2 files ± 0 2 suites ±0 58m 7s ⏱️ - 43m 58s Results for commit e74736b. ± Comparison against base commit 1b1d7cd. This pull request removes 1848 tests.
♻️ This comment has been updated with latest results. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTMT - nice way to recreate / restore the destination from an existing one
secret_arn = self.create_connection_secret( | ||
region, account_id, name, authorization_type, auth_parameters | ||
) | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
very nice way to decouple secret creation from api connection creation
@@ -64,6 +64,23 @@ def __init__( | |||
description, | |||
) | |||
|
|||
@classmethod | |||
def from_api_destination_and_connection( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: should e maybe name it create_... or restore_... to make it more clear?
@@ -52,6 +56,19 @@ def __init__( | |||
invocation_connectivity_parameters, | |||
) | |||
|
|||
@classmethod | |||
def from_connection(cls, connection: Connection): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same as above: nit: should e maybe name it create_... or restore_... to make it more clear?
d47e787
to
e74736b
Compare
Motivation
Following some issues to recreate internal services that hold state as those are re-creating their own ID every time you re-instantiate them, leading to issue in the persistence mechanism.
These class methods allow to recreate them and override the internal state they set.
Changes