Skip to content

How to apply DataProtectionPolicy to the log group created by a lambda function? #26394

Discussion options

You must be logged in to vote

@github-actions proposed-answer CDK has a couple ways to interact with this automatically created log group: a few of the props in the Lambda Function construct can be used to configure the retention policy of this automatically created log group, and you can also reference the log group by referring to the logGroup prop of a Lambda Function.

Under the hood, the CDK manages this log group with the help of the LogRetention construct. However, this construct doesn't offer the ability to set DataProtectionPolicy. What it does give us is an easy way to reference the Log Group.

I think the easiest way to achieve what you need will be to take the Function.logGroup.logGroupArn and supply it into…

Replies: 3 comments 3 replies

Comment options

You must be logged in to vote
3 replies
@github-actions
Comment options

@ericxinzhang
Comment options

@sanjaysaini23
Comment options

Answer selected by ericxinzhang
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants