aws / aws-cdk

The AWS Cloud Development Kit is a framework for defining cloud infrastructure in code
https://aws.amazon.com/cdk
Apache License 2.0
11.72k stars 3.94k forks source link

(aws-cdk-lib/aws-events-targets): `EventBus` target construct does not support `retryAttempts` or `maxEventAge` #28735

Open mattvalleycodes opened 10 months ago

mattvalleycodes commented 10 months ago

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, 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

Other Information

No response

Acknowledgements

CDK version used

2.121.1

Environment details (OS name and version, etc.)

Mac OS Sonomo 14.2.1 (23C71)

pahud commented 10 months ago

Thank you for the feature request and we welcome and appreciate your PRs.

mattvalleycodes commented 10 months ago

@pahud Great! I should be able to file a PR for this soon.