aws / aws/aws-cdk

aws_rum: Provide way of referencing the log created with cwLogEnabled

Open
#35,107 5 comments 1 reaction 0 assignees View on GitHub
@aws-cdk/aws-logs effort/medium feature-request needs-l2 p2
Dominant language
TypeScript
Stars
12.9k
Forks
4.6k
Avg merge
2d 3h
Merged PRs (30d)
83

Description

### Describe the feature

The `CfnAppMonitor` construct supports a [cwLogEnabled](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_rum.CfnAppMonitorProps.html#cwlogenabled) flag for creating CloudWatch logs associated with CloudWatch RUM. However, there's no way to either control or obtain the name of the log group.

The log group appears to follow the naming pattern

```
RUMService_${}${.slice(0, 8)}
```

The problem is that the ID is, itself, unknown at build time. Therefore, AFAICT there's no way to reference those logs from other CDK constructs.

### Use Case

I'd like to configure a Lambda to take actions based on certain events in the RUM logs, such as paging the engineering team.

### Proposed Solution

Other constructs that have a log option (such as `Distribution`'s [enableLogging](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_cloudfront.Distribution.html#enablelogging)) typically also expose a way of controlling the name/bucket for the logs.

It might also be possible for the construct to offer a `LogGroup` getter that, internally, uses `LogGroup.fromLogGroupName` (though I'm not sure on the details of how it would obtain the name, since the AppMonitor ID isn't determined until deploy time).

### Other Information

_No response_

### Acknowledgements

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

### AWS CDK Library version (aws-cdk-lib)

2.207.0

### AWS CDK CLI version

2.1023.0

### Environment details (OS name and version, etc.)

macOS

Contributor guide

Open the contributing guide

Research direction

Start with the CfnAppMonitor construct and its cwLogEnabled option, then compare how Distribution exposes control over logging resources. Investigate how the AppMonitor ID and generated CloudWatch log group name become available at deployment time. Done means a supported way for other CDK constructs to control or reference the RUM log group.

Written by the indexing model from the issue text.

Assessment

Tech stack
aws, typescript
Domain
cloud, infrastructure
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.