Skip to content

Commit

Permalink
feat(events): make target optional in onXxx() methods
Browse files Browse the repository at this point in the history
Make `target` optional in `OnEventOptions` so that it is no required when calling a `onXxx()`
method.

This allows to use "preconfigured" rules on other constructs.

Closes aws#2913
  • Loading branch information
jogold committed Jun 19, 2019
1 parent 1aa0589 commit d9b185b
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions packages/@aws-cdk/aws-events/lib/on-event-options.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,15 @@ import { IRuleTarget } from "./target";
export interface OnEventOptions {
/**
* The target to register for the event
*
* @default - No target is added to the rule. Use `addTarget()` to add a target.
*/
readonly target: IRuleTarget;
readonly target?: IRuleTarget;

/**
* A description of the rule's purpose.
*
* @default - No description
*/
readonly description?: string;

Expand All @@ -29,8 +33,10 @@ export interface OnEventOptions {
* filtering. The filtering implied by what you pass here is added
* on top of that filtering.
*
* @default - No additional filtering based on an event pattern.
*
* @see
* http://docs.aws.amazon.com/AmazonCloudWatch/latest/DeveloperGuide/CloudWatchEventsandEventPatterns.html
*/
readonly eventPattern?: EventPattern;
}
}

0 comments on commit d9b185b

Please sign in to comment.