(aws-synthetics-alpha): no way to specify CloudWatch log retention
- Dominant language
- TypeScript
- Stars
- 12.9k
- Forks
- 4.6k
- Avg merge
- 1d 19h
- Merged PRs (30d)
- 74
Description
### Describe the feature
At present when creating Synthetic Monitoring Canaries, there is no way to specify a log group for the canary to use. The log groups the canary generates have unpredictable names (they are suffixed with guids e.g. `/aws/lambda/cwsyn-{canaryName}-4798075b-20e3-494b-85ed-97a9f180e6d0`) so even retroactively adding log-retention is harder than is ideal (you have to deploy the canary, find out what the log group is, then modify the stack to add a `LogRetention`.
I realise this is potentially an issue with the underlying Canary resource rather than with CDK specifically, but CDK provides clever workarounds for some of this kind of behaviour elsewhere in AWS.
### Use Case
Most people don't want infinite log retention and the associated costs. The ability to easily set a retention period would be helpful.
### Proposed Solution
Ideally log retention could be specified via a property of the Canary construct similar to `logRetention` on Lambda functions. Alternatively access to a `logGroup` property would work.
### Other Information
_No response_
### Acknowledgements
- [ ] I may be able to implement this feature request
- [ ] This feature might incur a breaking change
### CDK version used
2.49.0
### Environment details (OS name and version, etc.)
N/A
Contributor guide
Research direction
Start with the aws-synthetics-alpha Canary construct and compare its configuration with the Lambda logRetention behavior mentioned in the issue. Investigate how canary log groups are created and whether the construct can expose retention or a log-group handle; done means users can configure retention without first deploying and discovering an unpredictable name.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- aws, typescript
- Domain
- cloud
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100