aws / aws/aws-cdk

lambda: allow propagating Function tags to LogGroup

Open
#17,533 9 comments 94 reactions 1 assignee Claimed by @QuantumNeuralCoder View on GitHub
@aws-cdk/aws-lambda effort/medium feature-request in-progress p1
Dominant language
TypeScript
Stars
12.9k
Forks
4.6k
Avg merge
2d 3h
Merged PRs (30d)
83

Description

### Description

When a lambda function is created via CDK, its LogGroup is not created right away. Instead it typically happens the first time the lambda executes. Consequently, the LogGroup does not have any of the function's tags applied to it. It would be nice if there were a way to mark the function to propagate tags to the LogGroup, perhaps via some custom resource. Ideally, this would be exposed as a mutable property so it can be toggled by an Aspect.

### Use Case

We want to be able to easily find LogGroups corresponding to particular lambda function tags via the resource tagging API. In particular, this will allow us to easily find and delete these LogGroups when they are no longer needed.

### Proposed Solution

Add a flag to the aws_lambda.Function construct indicating whether tags should be propagated. If so, create a custom resource to create the LogGroup if necessary, and then adjust its tags. It should account for adding new tags, deleting old tags, and modifying existing tags. It may be possible to combine this custom resource with the one that manages the LogGroup retention.

### Other information

_No response_

### Acknowledge

- [ ] I may be able to implement this feature request
- [ ] This feature might incur a breaking change

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.