From d9b185bb218ba49e56e622116a5721c64f1a010e Mon Sep 17 00:00:00 2001 From: Jonathan Goldwasser Date: Tue, 18 Jun 2019 17:10:38 +0200 Subject: [PATCH] feat(events): make target optional in `onXxx()` methods 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 #2913 --- packages/@aws-cdk/aws-events/lib/on-event-options.ts | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/packages/@aws-cdk/aws-events/lib/on-event-options.ts b/packages/@aws-cdk/aws-events/lib/on-event-options.ts index 047722cb35ab7..ff54919fcc8ba 100644 --- a/packages/@aws-cdk/aws-events/lib/on-event-options.ts +++ b/packages/@aws-cdk/aws-events/lib/on-event-options.ts @@ -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; @@ -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; -} \ No newline at end of file +}