-
Notifications
You must be signed in to change notification settings - Fork 3.8k
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(lambda): allow to delete log group of a lambda function when it is removed #21820
Closed
Closed
Changes from 11 commits
Commits
Show all changes
20 commits
Select commit
Hold shift + click to select a range
47abe0e
allow to delete log group of a lambda function when it is removed
tmokmss 577931b
update integ test
tmokmss 665df47
fix issue on multiple log retention
tmokmss 2f1291b
add unit test
tmokmss 4d5b564
remove unnecessary iam privilege
tmokmss b86dcd1
fix
tmokmss f3ce568
fix comment
tmokmss 55aae23
update integ test result
tmokmss 24df28f
refactor
tmokmss fbd72df
merge
tmokmss 7e85ab3
update integ test
tmokmss 6d66efd
Merge branch 'main' into lambda_auto_delete_log_group
tmokmss fff7bcd
Merge branch 'master' into lambda_auto_delete_log_group
tmokmss a4ffd59
merge
tmokmss 23da605
fix
tmokmss 65a84e0
merge
tmokmss 390e76d
merge
tmokmss 0fa9843
Merge branch 'main' into lambda_auto_delete_log_group
corymhall 7c7697e
merge
tmokmss 5d74c13
Merge branch 'upstream_main' into lambda_auto_delete_log_group
tmokmss 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 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Oops, something went wrong.
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.
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.
This is inconsistent with our contract elsewhere when the user sets the Removal Policy. Please see other places where we have done this and follow that model. You use the enum below.
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.
Hi @TheRealAmazonKendra thank you for the review!
This API is actually inspired by
s3.Bucket.autoDeleteObjects
. In this case the only concern for developers is whether the log group is automatically deleted or not. It is only a binary choice and there is no need to use RemovalPolicy enum to specify that. One of the main advantages of CDK constructs is abstraction, and here we abstract away RemovalPolicy to provide better developer experience.Also internally we do not use CloudFormation RemovalPolicy here but using a feature implemented in the LogRetention custom resource below. I'm not sure if it is inconsistent to use the different contract from other CFn removal policies. Isn't it natural that different things will have different contracts?
aws-cdk/packages/@aws-cdk/aws-logs/lib/log-retention.ts
Line 102 in 3e55092
I'm open to discussion about this :) currently I don't see much benefits to use enum here though.