-
Notifications
You must be signed in to change notification settings - Fork 434
feat(event_source): add CodeDeploy Lifecycle Hook event #5219
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
Merged
leandrodamascena
merged 10 commits into
aws-powertools:develop
from
mw-root:v3-add-codedeploy-lifecycle-hook-event-class
Sep 24, 2024
Merged
Changes from 2 commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
7ae433d
feat: Add CodeDeploy Lifecycle Hook event definition
mw-root 9e1c810
Add tests
mw-root 04a5285
Update aws_lambda_powertools/utilities/data_classes/code_deploy_lifec…
mw-root bf317fa
Update aws_lambda_powertools/utilities/data_classes/__init__.py
mw-root 983146e
Update tests/unit/data_classes/required_dependencies/test_code_deploy…
mw-root 3821220
Update tests/unit/data_classes/required_dependencies/test_code_deploy…
mw-root 573af29
Update aws_lambda_powertools/utilities/data_classes/__init__.py
mw-root 373aeb7
Add docs
mw-root 7db1e21
Update docs/utilities/data_classes.md
mw-root 1a56c94
Update docs/utilities/data_classes.md
mw-root File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
13 changes: 13 additions & 0 deletions
13
aws_lambda_powertools/utilities/data_classes/code_deploy_lifecycle_hook_event.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
from aws_lambda_powertools.utilities.data_classes.common import DictWrapper | ||
|
||
|
||
class CodeDeployLifeCycleHookLambdaEvent(DictWrapper): | ||
mw-root marked this conversation as resolved.
Show resolved
Hide resolved
|
||
@property | ||
def deployment_id(self) -> str: | ||
"""The unique ID of the calling CodeDeploy Deployment.""" | ||
return self["DeploymentId"] | ||
|
||
@property | ||
def lifecycle_event_hook_execution_id(self) -> str: | ||
"""The unique ID of a deployments lifecycle hook.""" | ||
return self["LifecycleEventHookExecutionId"] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
{ | ||
"DeploymentId": "d-ABCDEF", | ||
"LifecycleEventHookExecutionId": "xxxxxxxxxxxxxxxxxxxxxxxx" | ||
} |
20 changes: 20 additions & 0 deletions
20
tests/unit/data_classes/required_dependencies/test_code_deploy_lifecycle_hook_event.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
import pytest | ||
|
||
from aws_lambda_powertools.utilities.data_classes import ( | ||
CodeDeployLifeCycleHookLambdaEvent, | ||
mw-root marked this conversation as resolved.
Show resolved
Hide resolved
|
||
) | ||
from tests.functional.utils import load_event | ||
|
||
|
||
@pytest.mark.parametrize( | ||
"event_file", | ||
[ | ||
"codeDeployLifecycleHookEvent.json", | ||
], | ||
) | ||
def test_code_deploy_lifecycle_hook_event(event_file): | ||
raw_event = load_event(event_file) | ||
parsed_event = CodeDeployLifeCycleHookLambdaEvent(raw_event) | ||
mw-root marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
assert parsed_event.deployment_id == raw_event["DeploymentId"] | ||
assert parsed_event.lifecycle_event_hook_execution_id == raw_event["LifecycleEventHookExecutionId"] |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.