From 7388b1cc7a670e878141a7a69af424a225c5c1e4 Mon Sep 17 00:00:00 2001 From: yamatatsu Date: Fri, 22 Oct 2021 13:22:28 +0900 Subject: [PATCH] feat(iot): Add IAction --- packages/@aws-cdk/aws-iot/lib/action.ts | 24 ++++++++++++++++++++++++ packages/@aws-cdk/aws-iot/lib/index.ts | 1 + 2 files changed, 25 insertions(+) create mode 100644 packages/@aws-cdk/aws-iot/lib/action.ts diff --git a/packages/@aws-cdk/aws-iot/lib/action.ts b/packages/@aws-cdk/aws-iot/lib/action.ts new file mode 100644 index 0000000000000..a21168e479e55 --- /dev/null +++ b/packages/@aws-cdk/aws-iot/lib/action.ts @@ -0,0 +1,24 @@ +import { CfnTopicRule } from './iot.generated'; +import { ITopicRule } from './topic-rule'; + +/** + * An abstract action for TopicRule. + */ +export interface IAction { + /** + * Returns the topic rule action specification. + * + * @param rule The TopicRule that would trigger this action. + */ + bind(rule: ITopicRule): ActionConfig; +} + +/** + * Properties for an topic rule action + */ +export interface ActionConfig { + /** + * The configuration for this action. + */ + readonly configuration: CfnTopicRule.ActionProperty; +} diff --git a/packages/@aws-cdk/aws-iot/lib/index.ts b/packages/@aws-cdk/aws-iot/lib/index.ts index 18b6f2e03aaeb..f2e82a6c755b2 100644 --- a/packages/@aws-cdk/aws-iot/lib/index.ts +++ b/packages/@aws-cdk/aws-iot/lib/index.ts @@ -1,3 +1,4 @@ +export * from './action'; export * from './iot-sql'; export * from './topic-rule';