@aws-cdk/aws-iotevents-actions-alpha 2.34.2-alpha.0 → 2.37.0-alpha.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/.jsii CHANGED
@@ -8,8 +8,8 @@
8
8
  "url": "https://aws.amazon.com"
9
9
  },
10
10
  "dependencies": {
11
- "@aws-cdk/aws-iotevents-alpha": "2.34.2-alpha.0",
12
- "aws-cdk-lib": "^2.34.2",
11
+ "@aws-cdk/aws-iotevents-alpha": "2.37.0-alpha.0",
12
+ "aws-cdk-lib": "^2.37.0",
13
13
  "constructs": "^10.0.0"
14
14
  },
15
15
  "dependencyClosure": {
@@ -3056,7 +3056,7 @@
3056
3056
  "stability": "experimental"
3057
3057
  },
3058
3058
  "homepage": "https://github.com/aws/aws-cdk",
3059
- "jsiiVersion": "1.63.0 (build 7c24e36)",
3059
+ "jsiiVersion": "1.63.2 (build a8a8833)",
3060
3060
  "keywords": [
3061
3061
  "aws",
3062
3062
  "cdk",
@@ -3075,7 +3075,7 @@
3075
3075
  },
3076
3076
  "name": "@aws-cdk/aws-iotevents-actions-alpha",
3077
3077
  "readme": {
3078
- "markdown": "# Actions for AWS::IoTEvents Detector Model\n<!--BEGIN STABILITY BANNER-->\n\n---\n\n![cdk-constructs: Experimental](https://img.shields.io/badge/cdk--constructs-experimental-important.svg?style=for-the-badge)\n\n> The APIs of higher level constructs in this module are experimental and under active development.\n> They are subject to non-backward compatible changes or removal in any future version. These are\n> not subject to the [Semantic Versioning](https://semver.org/) model and breaking changes will be\n> announced in the release notes. This means that while you may use them, you may need to update\n> your source code when upgrading to a newer version of this package.\n\n---\n\n<!--END STABILITY BANNER-->\n\nThis library contains integration classes to specify actions of state events of Detector Model in `@aws-cdk/aws-iotevents`.\nInstances of these classes should be passed to `State` defined in `@aws-cdk/aws-iotevents`\nYou can define built-in actions to use a timer or set a variable, or send data to other AWS resources.\n\nThis library contains integration classes to use a timer or set a variable, or send data to other AWS resources.\nAWS IoT Events can trigger actions when it detects a specified event or transition event.\n\nCurrently supported are:\n\n- Set variable to detector instanse\n- Invoke a Lambda function\n\n## Set variable to detector instanse\n\nThe code snippet below creates an Action that set variable to detector instanse\nwhen it is triggered.\n\n```ts\nimport * as iotevents from '@aws-cdk/aws-iotevents-alpha';\nimport * as actions from '@aws-cdk/aws-iotevents-actions-alpha';\n\ndeclare const input: iotevents.IInput;\n\nconst state = new iotevents.State({\n stateName: 'MyState',\n onEnter: [{\n eventName: 'test-event',\n condition: iotevents.Expression.currentInput(input),\n actions: [\n actions: [\n new actions.SetVariableAction(\n 'MyVariable',\n iotevents.Expression.inputAttribute(input, 'payload.temperature'),\n ),\n ],\n ],\n }],\n});\n```\n\n## Invoke a Lambda function\n\nThe code snippet below creates an Action that invoke a Lambda function\nwhen it is triggered.\n\n```ts\nimport * as iotevents from '@aws-cdk/aws-iotevents-alpha';\nimport * as actions from '@aws-cdk/aws-iotevents-actions-alpha';\nimport * as lambda from 'aws-cdk-lib/aws-lambda';\n\ndeclare const input: iotevents.IInput;\ndeclare const func: lambda.IFunction;\n\nconst state = new iotevents.State({\n stateName: 'MyState',\n onEnter: [{\n eventName: 'test-event',\n condition: iotevents.Expression.currentInput(input),\n actions: [new actions.LambdaInvokeAction(func)],\n }],\n});\n```\n"
3078
+ "markdown": "# Actions for AWS::IoTEvents Detector Model\n<!--BEGIN STABILITY BANNER-->\n\n---\n\n![cdk-constructs: Experimental](https://img.shields.io/badge/cdk--constructs-experimental-important.svg?style=for-the-badge)\n\n> The APIs of higher level constructs in this module are experimental and under active development.\n> They are subject to non-backward compatible changes or removal in any future version. These are\n> not subject to the [Semantic Versioning](https://semver.org/) model and breaking changes will be\n> announced in the release notes. This means that while you may use them, you may need to update\n> your source code when upgrading to a newer version of this package.\n\n---\n\n<!--END STABILITY BANNER-->\n\nThis library contains integration classes to specify actions of state events of Detector Model in `@aws-cdk/aws-iotevents`.\nInstances of these classes should be passed to `State` defined in `@aws-cdk/aws-iotevents`\nYou can define built-in actions to use a timer or set a variable, or send data to other AWS resources.\n\nThis library contains integration classes to use a timer or set a variable, or send data to other AWS resources.\nAWS IoT Events can trigger actions when it detects a specified event or transition event.\n\nCurrently supported are:\n\n- Use timer\n- Set variable to detector instanse\n- Invoke a Lambda function\n\n## Use timer\n\nThe code snippet below creates an Action that creates the timer with duration in seconds.\n\n```ts\nimport * as iotevents from '@aws-cdk/aws-iotevents-alpha';\nimport * as actions from '@aws-cdk/aws-iotevents-actions-alpha';\n\ndeclare const input: iotevents.IInput;\n\nconst state = new iotevents.State({\n stateName: 'MyState',\n onEnter: [{\n eventName: 'test-event',\n condition: iotevents.Expression.currentInput(input),\n actions: [\n new actions.SetTimerAction('MyTimer', {\n duration: cdk.Duration.seconds(60),\n }),\n ],\n }],\n});\n```\n\nSetting duration by [IoT Events Expression](https://docs.aws.amazon.com/iotevents/latest/developerguide/iotevents-expressions.html):\n\n```ts\nnew actions.SetTimerAction('MyTimer', {\n durationExpression: iotevents.Expression.inputAttribute(input, 'payload.durationSeconds'),\n})\n```\n\nAnd the timer can be reset and cleared. Below is an example of general\n[Device HeartBeat](https://docs.aws.amazon.com/iotevents/latest/developerguide/iotevents-examples-dhb.html)\nDetector Model:\n\n```ts\nconst online = new iotevents.State({\n stateName: 'Online',\n onEnter: [{\n eventName: 'enter-event',\n condition: iotevents.Expression.currentInput(input),\n actions: [\n new actions.SetTimerAction('MyTimer', {\n duration: cdk.Duration.seconds(60),\n }),\n ],\n }],\n onInput: [{\n eventName: 'input-event',\n condition: iotevents.Expression.currentInput(input),\n actions: [\n new actions.ResetTimerAction('MyTimer'),\n ],\n }],\n onExit: [{\n eventName: 'exit-event',\n actions: [\n new actions.ClearTimerAction('MyTimer'),\n ],\n }],\n});\nconst offline = new iotevents.State({ stateName: 'Offline' });\n\nonline.transitionTo(offline, { when: iotevents.Expression.timeout('MyTimer') });\noffline.transitionTo(online, { when: iotevents.Expression.currentInput(input) });\n```\n\n## Set variable to detector instanse\n\nThe code snippet below creates an Action that set variable to detector instanse\nwhen it is triggered.\n\n```ts\nimport * as iotevents from '@aws-cdk/aws-iotevents-alpha';\nimport * as actions from '@aws-cdk/aws-iotevents-actions-alpha';\n\ndeclare const input: iotevents.IInput;\n\nconst state = new iotevents.State({\n stateName: 'MyState',\n onEnter: [{\n eventName: 'test-event',\n condition: iotevents.Expression.currentInput(input),\n actions: [\n new actions.SetVariableAction(\n 'MyVariable',\n iotevents.Expression.inputAttribute(input, 'payload.temperature'),\n ),\n ],\n }],\n});\n```\n\n## Invoke a Lambda function\n\nThe code snippet below creates an Action that invoke a Lambda function\nwhen it is triggered.\n\n```ts\nimport * as iotevents from '@aws-cdk/aws-iotevents-alpha';\nimport * as actions from '@aws-cdk/aws-iotevents-actions-alpha';\nimport * as lambda from 'aws-cdk-lib/aws-lambda';\n\ndeclare const input: iotevents.IInput;\ndeclare const func: lambda.IFunction;\n\nconst state = new iotevents.State({\n stateName: 'MyState',\n onEnter: [{\n eventName: 'test-event',\n condition: iotevents.Expression.currentInput(input),\n actions: [new actions.LambdaInvokeAction(func)],\n }],\n});\n```\n"
3079
3079
  },
3080
3080
  "repository": {
3081
3081
  "directory": "packages/individual-packages/aws-iotevents-actions",
@@ -3113,6 +3113,48 @@
3113
3113
  }
3114
3114
  },
3115
3115
  "types": {
3116
+ "@aws-cdk/aws-iotevents-actions-alpha.ClearTimerAction": {
3117
+ "assembly": "@aws-cdk/aws-iotevents-actions-alpha",
3118
+ "docs": {
3119
+ "stability": "experimental",
3120
+ "summary": "The action to delete an existing timer.",
3121
+ "example": "// The code below shows an example of how to instantiate this type.\n// The values are placeholders you should change.\nimport * as iotevents_actions_alpha from '@aws-cdk/aws-iotevents-actions-alpha';\nconst clearTimerAction = new iotevents_actions_alpha.ClearTimerAction('timerName');",
3122
+ "custom": {
3123
+ "exampleMetadata": "fixture=_generated"
3124
+ }
3125
+ },
3126
+ "fqn": "@aws-cdk/aws-iotevents-actions-alpha.ClearTimerAction",
3127
+ "initializer": {
3128
+ "docs": {
3129
+ "stability": "experimental"
3130
+ },
3131
+ "locationInModule": {
3132
+ "filename": "lib/clear-timer-action.ts",
3133
+ "line": 11
3134
+ },
3135
+ "parameters": [
3136
+ {
3137
+ "docs": {
3138
+ "summary": "the name of the timer."
3139
+ },
3140
+ "name": "timerName",
3141
+ "type": {
3142
+ "primitive": "string"
3143
+ }
3144
+ }
3145
+ ]
3146
+ },
3147
+ "interfaces": [
3148
+ "@aws-cdk/aws-iotevents-alpha.IAction"
3149
+ ],
3150
+ "kind": "class",
3151
+ "locationInModule": {
3152
+ "filename": "lib/clear-timer-action.ts",
3153
+ "line": 7
3154
+ },
3155
+ "name": "ClearTimerAction",
3156
+ "symbolId": "lib/clear-timer-action:ClearTimerAction"
3157
+ },
3116
3158
  "@aws-cdk/aws-iotevents-actions-alpha.LambdaInvokeAction": {
3117
3159
  "assembly": "@aws-cdk/aws-iotevents-actions-alpha",
3118
3160
  "docs": {
@@ -3152,41 +3194,101 @@
3152
3194
  "filename": "lib/lambda-invoke-action.ts",
3153
3195
  "line": 8
3154
3196
  },
3155
- "methods": [
3156
- {
3157
- "docs": {
3158
- "stability": "experimental",
3159
- "summary": "Returns the AWS IoT Events action specification."
3160
- },
3161
- "locationInModule": {
3162
- "filename": "lib/lambda-invoke-action.ts",
3163
- "line": 15
3164
- },
3165
- "name": "bind",
3166
- "overrides": "@aws-cdk/aws-iotevents-alpha.IAction",
3167
- "parameters": [
3168
- {
3169
- "name": "_scope",
3170
- "type": {
3171
- "fqn": "constructs.Construct"
3172
- }
3197
+ "name": "LambdaInvokeAction",
3198
+ "symbolId": "lib/lambda-invoke-action:LambdaInvokeAction"
3199
+ },
3200
+ "@aws-cdk/aws-iotevents-actions-alpha.ResetTimerAction": {
3201
+ "assembly": "@aws-cdk/aws-iotevents-actions-alpha",
3202
+ "docs": {
3203
+ "stability": "experimental",
3204
+ "summary": "The action to reset an existing timer.",
3205
+ "example": "// The code below shows an example of how to instantiate this type.\n// The values are placeholders you should change.\nimport * as iotevents_actions_alpha from '@aws-cdk/aws-iotevents-actions-alpha';\nconst resetTimerAction = new iotevents_actions_alpha.ResetTimerAction('timerName');",
3206
+ "custom": {
3207
+ "exampleMetadata": "fixture=_generated"
3208
+ }
3209
+ },
3210
+ "fqn": "@aws-cdk/aws-iotevents-actions-alpha.ResetTimerAction",
3211
+ "initializer": {
3212
+ "docs": {
3213
+ "stability": "experimental"
3214
+ },
3215
+ "locationInModule": {
3216
+ "filename": "lib/reset-timer-action.ts",
3217
+ "line": 11
3218
+ },
3219
+ "parameters": [
3220
+ {
3221
+ "docs": {
3222
+ "summary": "the name of the timer."
3173
3223
  },
3174
- {
3175
- "name": "options",
3176
- "type": {
3177
- "fqn": "@aws-cdk/aws-iotevents-alpha.ActionBindOptions"
3178
- }
3224
+ "name": "timerName",
3225
+ "type": {
3226
+ "primitive": "string"
3179
3227
  }
3180
- ],
3181
- "returns": {
3228
+ }
3229
+ ]
3230
+ },
3231
+ "interfaces": [
3232
+ "@aws-cdk/aws-iotevents-alpha.IAction"
3233
+ ],
3234
+ "kind": "class",
3235
+ "locationInModule": {
3236
+ "filename": "lib/reset-timer-action.ts",
3237
+ "line": 7
3238
+ },
3239
+ "name": "ResetTimerAction",
3240
+ "symbolId": "lib/reset-timer-action:ResetTimerAction"
3241
+ },
3242
+ "@aws-cdk/aws-iotevents-actions-alpha.SetTimerAction": {
3243
+ "assembly": "@aws-cdk/aws-iotevents-actions-alpha",
3244
+ "docs": {
3245
+ "custom": {
3246
+ "exampleMetadata": "infused"
3247
+ },
3248
+ "example": "import * as iotevents from '@aws-cdk/aws-iotevents-alpha';\nimport * as actions from '@aws-cdk/aws-iotevents-actions-alpha';\n\ndeclare const input: iotevents.IInput;\n\nconst state = new iotevents.State({\n stateName: 'MyState',\n onEnter: [{\n eventName: 'test-event',\n condition: iotevents.Expression.currentInput(input),\n actions: [\n new actions.SetTimerAction('MyTimer', {\n duration: cdk.Duration.seconds(60),\n }),\n ],\n }],\n});",
3249
+ "stability": "experimental",
3250
+ "summary": "The action to create a timer with duration in seconds."
3251
+ },
3252
+ "fqn": "@aws-cdk/aws-iotevents-actions-alpha.SetTimerAction",
3253
+ "initializer": {
3254
+ "docs": {
3255
+ "stability": "experimental"
3256
+ },
3257
+ "locationInModule": {
3258
+ "filename": "lib/set-timer-action.ts",
3259
+ "line": 13
3260
+ },
3261
+ "parameters": [
3262
+ {
3263
+ "docs": {
3264
+ "summary": "the name of the timer."
3265
+ },
3266
+ "name": "timerName",
3182
3267
  "type": {
3183
- "fqn": "@aws-cdk/aws-iotevents-alpha.ActionConfig"
3268
+ "primitive": "string"
3269
+ }
3270
+ },
3271
+ {
3272
+ "docs": {
3273
+ "summary": "the duration of the timer."
3274
+ },
3275
+ "name": "timerDuration",
3276
+ "type": {
3277
+ "fqn": "@aws-cdk/aws-iotevents-actions-alpha.TimerDuration"
3184
3278
  }
3185
3279
  }
3186
- }
3280
+ ]
3281
+ },
3282
+ "interfaces": [
3283
+ "@aws-cdk/aws-iotevents-alpha.IAction"
3187
3284
  ],
3188
- "name": "LambdaInvokeAction",
3189
- "symbolId": "lib/lambda-invoke-action:LambdaInvokeAction"
3285
+ "kind": "class",
3286
+ "locationInModule": {
3287
+ "filename": "lib/set-timer-action.ts",
3288
+ "line": 8
3289
+ },
3290
+ "name": "SetTimerAction",
3291
+ "symbolId": "lib/set-timer-action:SetTimerAction"
3190
3292
  },
3191
3293
  "@aws-cdk/aws-iotevents-actions-alpha.SetVariableAction": {
3192
3294
  "assembly": "@aws-cdk/aws-iotevents-actions-alpha",
@@ -3194,7 +3296,7 @@
3194
3296
  "custom": {
3195
3297
  "exampleMetadata": "infused"
3196
3298
  },
3197
- "example": "import * as iotevents from '@aws-cdk/aws-iotevents-alpha';\nimport * as actions from '@aws-cdk/aws-iotevents-actions-alpha';\n\ndeclare const input: iotevents.IInput;\n\nconst state = new iotevents.State({\n stateName: 'MyState',\n onEnter: [{\n eventName: 'test-event',\n condition: iotevents.Expression.currentInput(input),\n actions: [\n actions: [\n new actions.SetVariableAction(\n 'MyVariable',\n iotevents.Expression.inputAttribute(input, 'payload.temperature'),\n ),\n ],\n ],\n }],\n});",
3299
+ "example": "import * as iotevents from '@aws-cdk/aws-iotevents-alpha';\nimport * as actions from '@aws-cdk/aws-iotevents-actions-alpha';\n\ndeclare const input: iotevents.IInput;\n\nconst state = new iotevents.State({\n stateName: 'MyState',\n onEnter: [{\n eventName: 'test-event',\n condition: iotevents.Expression.currentInput(input),\n actions: [\n new actions.SetVariableAction(\n 'MyVariable',\n iotevents.Expression.inputAttribute(input, 'payload.temperature'),\n ),\n ],\n }],\n});",
3198
3300
  "stability": "experimental",
3199
3301
  "summary": "The action to create a variable with a specified value."
3200
3302
  },
@@ -3236,43 +3338,89 @@
3236
3338
  "filename": "lib/set-variable-action.ts",
3237
3339
  "line": 7
3238
3340
  },
3341
+ "name": "SetVariableAction",
3342
+ "symbolId": "lib/set-variable-action:SetVariableAction"
3343
+ },
3344
+ "@aws-cdk/aws-iotevents-actions-alpha.TimerDuration": {
3345
+ "abstract": true,
3346
+ "assembly": "@aws-cdk/aws-iotevents-actions-alpha",
3347
+ "docs": {
3348
+ "custom": {
3349
+ "exampleMetadata": "infused"
3350
+ },
3351
+ "example": "import * as iotevents from '@aws-cdk/aws-iotevents-alpha';\nimport * as actions from '@aws-cdk/aws-iotevents-actions-alpha';\n\ndeclare const input: iotevents.IInput;\n\nconst state = new iotevents.State({\n stateName: 'MyState',\n onEnter: [{\n eventName: 'test-event',\n condition: iotevents.Expression.currentInput(input),\n actions: [\n new actions.SetTimerAction('MyTimer', {\n duration: cdk.Duration.seconds(60),\n }),\n ],\n }],\n});",
3352
+ "stability": "experimental",
3353
+ "summary": "The duration of the timer."
3354
+ },
3355
+ "fqn": "@aws-cdk/aws-iotevents-actions-alpha.TimerDuration",
3356
+ "initializer": {
3357
+ "docs": {
3358
+ "stability": "experimental"
3359
+ }
3360
+ },
3361
+ "kind": "class",
3362
+ "locationInModule": {
3363
+ "filename": "lib/timer-duration.ts",
3364
+ "line": 7
3365
+ },
3239
3366
  "methods": [
3240
3367
  {
3241
3368
  "docs": {
3369
+ "remarks": "The range of the duration is 60-31622400 seconds.\nThe evaluated result of the duration expression is rounded down to the nearest whole number.\nFor example, if you set the timer to 60.99 seconds, the evaluated result of the duration expression is 60 seconds.",
3242
3370
  "stability": "experimental",
3243
- "summary": "Returns the AWS IoT Events action specification."
3371
+ "summary": "Create a timer-duration from Duration."
3244
3372
  },
3245
3373
  "locationInModule": {
3246
- "filename": "lib/set-variable-action.ts",
3374
+ "filename": "lib/timer-duration.ts",
3247
3375
  "line": 15
3248
3376
  },
3249
- "name": "bind",
3250
- "overrides": "@aws-cdk/aws-iotevents-alpha.IAction",
3377
+ "name": "fromDuration",
3251
3378
  "parameters": [
3252
3379
  {
3253
- "name": "_scope",
3380
+ "name": "duration",
3254
3381
  "type": {
3255
- "fqn": "constructs.Construct"
3382
+ "fqn": "aws-cdk-lib.Duration"
3256
3383
  }
3257
- },
3384
+ }
3385
+ ],
3386
+ "returns": {
3387
+ "type": {
3388
+ "fqn": "@aws-cdk/aws-iotevents-actions-alpha.TimerDuration"
3389
+ }
3390
+ },
3391
+ "static": true
3392
+ },
3393
+ {
3394
+ "docs": {
3395
+ "remarks": "You can use a string expression that includes numbers, variables ($variable.<variable-name>),\nand input values ($input.<input-name>.<path-to-datum>) as the duration.\n\nThe range of the duration is 60-31622400 seconds.\nThe evaluated result of the duration expression is rounded down to the nearest whole number.\nFor example, if you set the timer to 60.99 seconds, the evaluated result of the duration expression is 60 seconds.",
3396
+ "stability": "experimental",
3397
+ "summary": "Create a timer-duration from Expression."
3398
+ },
3399
+ "locationInModule": {
3400
+ "filename": "lib/timer-duration.ts",
3401
+ "line": 36
3402
+ },
3403
+ "name": "fromExpression",
3404
+ "parameters": [
3258
3405
  {
3259
- "name": "_options",
3406
+ "name": "expression",
3260
3407
  "type": {
3261
- "fqn": "@aws-cdk/aws-iotevents-alpha.ActionBindOptions"
3408
+ "fqn": "@aws-cdk/aws-iotevents-alpha.Expression"
3262
3409
  }
3263
3410
  }
3264
3411
  ],
3265
3412
  "returns": {
3266
3413
  "type": {
3267
- "fqn": "@aws-cdk/aws-iotevents-alpha.ActionConfig"
3414
+ "fqn": "@aws-cdk/aws-iotevents-actions-alpha.TimerDuration"
3268
3415
  }
3269
- }
3416
+ },
3417
+ "static": true
3270
3418
  }
3271
3419
  ],
3272
- "name": "SetVariableAction",
3273
- "symbolId": "lib/set-variable-action:SetVariableAction"
3420
+ "name": "TimerDuration",
3421
+ "symbolId": "lib/timer-duration:TimerDuration"
3274
3422
  }
3275
3423
  },
3276
- "version": "2.34.2-alpha.0",
3424
+ "version": "2.37.0-alpha.0",
3277
3425
  "fingerprint": "**********"
3278
- }
3426
+ }