(aws-cdk-lib/aws-events-targets): `EventBus` target construct does not support `retryAttempts` or `maxEventAge`
- Dominant language
- TypeScript
- Stars
- 12.9k
- Forks
- 4.6k
- Avg merge
- 2d 3h
- Merged PRs (30d)
- 83
Description
### Describe the feature
Unlike other target constructs, including but not limited to `LambdaFunction` or `SfnStateMachine`, the `EventBus` target construct does not support the `retryAttempts` or `maxEventAge` props.
By looking at the ref CloudFormation doc for the [AWS::Events::Rule](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-events-rule.html), I can see that it does indeed support Retry Policy. Considering other target constructs support this feature, it would be good to have it implemented for `EventBus` as well.
### Use Case
We're using EventBridge heavily to implement our event-oriented architecture following the Hub & Spoke pattern. Each business domain has a dedicated `Event Bridge` that uses a Rule to push events to the centralised Hub event bridge. Right now, we rely on the default retry policy (as we don't have a way to customise it via CDK). The issue is that the default 24 hours is way too long for us, we would like the fail procedure to complete significantly faster, for example in 10 minutes. The issue is that the default 24 hours is way too long for us; we would like the fail procedure to complete significantly faster, for example, in 10 minutes.
### Proposed Solution
- Leverage the existing `TargetBaseProps` interface to support the new props
- Leverage the existing `bindBaseTargetConfig` to inject the new `retryPolicy` using the provided input
### Other Information
_No response_
### Acknowledgements
- [X] I may be able to implement this feature request
- [ ] This feature might incur a breaking change
### CDK version used
2.121.1
### Environment details (OS name and version, etc.)
Mac OS Sonomo 14.2.1 (23C71)
Contributor guide
Research direction
Start at the EventBus target construct and compare it with targets such as LambdaFunction or SfnStateMachine. Trace TargetBaseProps and bindBaseTargetConfig, then verify that retryAttempts and maxEventAge are represented in the generated AWS::Events::Rule retry policy and covered by the relevant construct tests.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- aws, typescript
- Domain
- cloud
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100