-
Notifications
You must be signed in to change notification settings - Fork 4.2k
feat(lambda): allow propagating function tags to loggroup #34473
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 propagating function tags to loggroup #34473
Conversation
...s/@aws-cdk-testing/framework-integ/test/aws-lambda/test/integ.lambda.loggroup-tag-inherit.ts
Outdated
Show resolved
Hide resolved
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.
Approved with one comment
| **logRetention prop** | Legacy approach using Custom Resource | False | False | False | Does not support TPA | | ||
| **logGroup prop** | Explicitly supplied by user in CDK app | True | True | True | Full support for TPA | | ||
| **Lazy creation** | Lambda service creates logGroup on first invocation | False | False | False | Occurs when both logRetention and logGroup are undefined and USE_CDK_MANAGED_LOGGROUP is false | | ||
| **USE_CDK_MANAGED_LOGGROUP** | CDK Lambda function construct creates log group with default props | True | True | True | Feature flag must be enabled | |
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.
I think you missed my last comment on How is prop injection enabled for the USE_CDK_MANAGED_LOGGROUP
enabled use case?
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.
follows the same pattern as current constructs added to construct tree. I have not tested Prop Injectors and Aspects for this change since this focussed on Tag propagation. The statements on support for these features stated in readme come from the fact that the new logGroup is being added to the construct tree and follows the same support of CDK features as a logGroup created in the CDK app by the user.
`, | ||
introducedIn: { v2: 'V2_NEXT' }, | ||
recommendedValue: true, | ||
compatibilityWithOldBehaviorMd: 'Disable the feature flag to let lambda service create logGroup or specify logGroup or logRetention', |
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.
Is this helpful for the users? Isn't this supposed to explain to customers how to turn on the feature flag and still have a working stack without issues? In that case, this should somehow explain how to import the existing log group into the stack, no? I might be wrong, or it might be too complicated, but I wanted to double-check.
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.
Yes I agree we should put (or at least link to) migration instructions here.
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.
I'm not sure why we need an instruction here? Existing users would always maintain their current behaviours as is without this feature flag. New users by default opt in with this feature flag enabled. This compaibility with old behaviour IMO is for new users who wish to use the old behaviour and the description makes sense here to disable the feature flag.
d67e56c
to
92ad68a
Compare
Comments on closed issues and PRs are hard for our team to see. |
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.
The pull request linter fails with the following errors:
❌ Features must contain a change to a README file.
❌ Features must contain a change to a test file.
❌ Features must contain a change to an integration test file and the resulting snapshot.
If you believe this pull request should receive an exemption, please comment and provide a justification. A comment requesting an exemption should contain the text Exemption Request
. Additionally, if clarification is needed, add Clarification Request
to a comment.
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
same as #34331 but clean copy with feedback addressed
Issue # (if applicable)
Creates a loggroup if not specified by the user without waiting for the first run of lambda to create the loggroup by the service. this enables function tags to be applied to the loggroups.
Closes #.
#17533
Reason for this change
Refer README and issue.
Description of changes
Added a feature flag USE_CDK_MANAGED_LOGGROUP
Refer README section on ## Customizing Log Group Creation for more details
Describe any new or updated permissions being added
N/A
Description of how you validated changes
Unit and integ tests are added to this PR
Checklist
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license