@aws-cdk/aws-iotevents-alpha 2.13.0-alpha.0 → 2.16.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 +263 -32
- package/.jsii.tabl.json +386 -228
- package/.warnings.jsii.js +25 -11
- package/README.md +18 -1
- package/lib/action.d.ts +30 -0
- package/lib/action.js +3 -0
- package/lib/detector-model.js +3 -3
- package/lib/event.d.ts +9 -2
- package/lib/event.js +1 -1
- package/lib/expression.js +1 -1
- package/lib/index.d.ts +1 -0
- package/lib/index.js +2 -1
- package/lib/input.js +1 -1
- package/lib/state.d.ts +28 -6
- package/lib/state.js +32 -20
- package/package.json +8 -8
package/.jsii
CHANGED
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
"url": "https://aws.amazon.com"
|
|
9
9
|
},
|
|
10
10
|
"dependencies": {
|
|
11
|
-
"aws-cdk-lib": "^2.
|
|
11
|
+
"aws-cdk-lib": "^2.16.0",
|
|
12
12
|
"constructs": "^10.0.0"
|
|
13
13
|
},
|
|
14
14
|
"dependencyClosure": {
|
|
@@ -2861,6 +2861,19 @@
|
|
|
2861
2861
|
"module": "aws_cdk.region_info"
|
|
2862
2862
|
}
|
|
2863
2863
|
}
|
|
2864
|
+
},
|
|
2865
|
+
"aws-cdk-lib.triggers": {
|
|
2866
|
+
"targets": {
|
|
2867
|
+
"dotnet": {
|
|
2868
|
+
"namespace": "Amazon.CDK.Triggers"
|
|
2869
|
+
},
|
|
2870
|
+
"java": {
|
|
2871
|
+
"package": "software.amazon.awscdk.triggers"
|
|
2872
|
+
},
|
|
2873
|
+
"python": {
|
|
2874
|
+
"module": "aws_cdk.triggers"
|
|
2875
|
+
}
|
|
2876
|
+
}
|
|
2864
2877
|
}
|
|
2865
2878
|
},
|
|
2866
2879
|
"targets": {
|
|
@@ -2942,7 +2955,7 @@
|
|
|
2942
2955
|
},
|
|
2943
2956
|
"name": "@aws-cdk/aws-iotevents-alpha",
|
|
2944
2957
|
"readme": {
|
|
2945
|
-
"markdown": "# AWS::IoTEvents Construct Library\n\n<!--BEGIN STABILITY BANNER-->\n\n---\n\n\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\nAWS IoT Events enables you to monitor your equipment or device fleets for\nfailures or changes in operation, and to trigger actions when such events\noccur.\n\n## Installation\n\nInstall the module:\n\n```console\n$ npm i @aws-cdk/aws-iotevents\n```\n\nImport it into your code:\n\n```ts nofixture\nimport * as iotevents from '@aws-cdk/aws-iotevents-alpha';\n```\n\n## `DetectorModel`\n\nThe following example creates an AWS IoT Events detector model to your stack.\nThe detector model need a reference to at least one AWS IoT Events input.\nAWS IoT Events inputs enable the detector to get MQTT payload values from IoT Core rules.\n\n```ts\nimport * as iotevents from '@aws-cdk/aws-iotevents-alpha';\n\nconst input = new iotevents.Input(this, 'MyInput', {\n inputName: 'my_input', // optional\n attributeJsonPaths: ['payload.deviceId', 'payload.temperature'],\n});\n\nconst warmState = new iotevents.State({\n stateName: 'warm',\n onEnter: [{\n eventName: 'test-event',\n condition: iotevents.Expression.currentInput(input),\n }],\n});\nconst coldState = new iotevents.State({\n stateName: 'cold',\n});\n\n// transit to coldState when temperature is 10\nwarmState.transitionTo(coldState, {\n eventName: 'to_coldState', // optional property, default by combining the names of the States\n when: iotevents.Expression.eq(\n iotevents.Expression.inputAttribute(input, 'payload.temperature'),\n iotevents.Expression.fromString('10'),\n ),\n});\n// transit to warmState when temperature is 20\ncoldState.transitionTo(warmState, {\n when: iotevents.Expression.eq(\n iotevents.Expression.inputAttribute(input, 'payload.temperature'),\n iotevents.Expression.fromString('20'),\n ),\n});\n\nnew iotevents.DetectorModel(this, 'MyDetectorModel', {\n detectorModelName: 'test-detector-model', // optional\n description: 'test-detector-model-description', // optional property, default is none\n evaluationMethod: iotevents.EventEvaluation.SERIAL, // optional property, default is iotevents.EventEvaluation.BATCH\n detectorKey: 'payload.deviceId', // optional property, default is none and single detector instance will be created and all inputs will be routed to it\n initialState: warmState,\n});\n```\n\nTo grant permissions to put messages in the input,\nyou can use the `grantWrite()` method:\n\n```ts\nimport * as iam from 'aws-cdk-lib/aws-iam';\nimport * as iotevents from '@aws-cdk/aws-iotevents-alpha';\n\ndeclare const grantable: iam.IGrantable;\nconst input = iotevents.Input.fromInputName(this, 'MyInput', 'my_input');\n\ninput.grantWrite(grantable);\n```\n"
|
|
2958
|
+
"markdown": "# AWS::IoTEvents Construct Library\n\n<!--BEGIN STABILITY BANNER-->\n\n---\n\n\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\nAWS IoT Events enables you to monitor your equipment or device fleets for\nfailures or changes in operation, and to trigger actions when such events\noccur.\n\n## Installation\n\nInstall the module:\n\n```console\n$ npm i @aws-cdk/aws-iotevents\n```\n\nImport it into your code:\n\n```ts nofixture\nimport * as iotevents from '@aws-cdk/aws-iotevents-alpha';\n```\n\n## `DetectorModel`\n\nThe following example creates an AWS IoT Events detector model to your stack.\nThe detector model need a reference to at least one AWS IoT Events input.\nAWS IoT Events inputs enable the detector to get MQTT payload values from IoT Core rules.\n\nYou can define built-in actions to use a timer or set a variable, or send data to other AWS resources.\nSee also [@aws-cdk/aws-iotevents-actions](https://docs.aws.amazon.com/cdk/api/v1/docs/aws-iotevents-actions-readme.html) for other actions.\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 func: lambda.IFunction;\n\nconst input = new iotevents.Input(this, 'MyInput', {\n inputName: 'my_input', // optional\n attributeJsonPaths: ['payload.deviceId', 'payload.temperature'],\n});\n\nconst warmState = new iotevents.State({\n stateName: 'warm',\n onEnter: [{\n eventName: 'test-enter-event',\n condition: iotevents.Expression.currentInput(input),\n actions: [new actions.LambdaInvokeAction(func)], // optional\n }],\n onInput: [{ // optional\n eventName: 'test-input-event',\n actions: [new actions.LambdaInvokeAction(func)],\n }],\n onExit: [{ // optional\n eventName: 'test-exit-event',\n actions: [new actions.LambdaInvokeAction(func)],\n }],\n});\nconst coldState = new iotevents.State({\n stateName: 'cold',\n});\n\n// transit to coldState when temperature is 10\nwarmState.transitionTo(coldState, {\n eventName: 'to_coldState', // optional property, default by combining the names of the States\n when: iotevents.Expression.eq(\n iotevents.Expression.inputAttribute(input, 'payload.temperature'),\n iotevents.Expression.fromString('10'),\n ),\n executing: [new actions.LambdaInvokeAction(func)], // optional\n});\n// transit to warmState when temperature is 20\ncoldState.transitionTo(warmState, {\n when: iotevents.Expression.eq(\n iotevents.Expression.inputAttribute(input, 'payload.temperature'),\n iotevents.Expression.fromString('20'),\n ),\n});\n\nnew iotevents.DetectorModel(this, 'MyDetectorModel', {\n detectorModelName: 'test-detector-model', // optional\n description: 'test-detector-model-description', // optional property, default is none\n evaluationMethod: iotevents.EventEvaluation.SERIAL, // optional property, default is iotevents.EventEvaluation.BATCH\n detectorKey: 'payload.deviceId', // optional property, default is none and single detector instance will be created and all inputs will be routed to it\n initialState: warmState,\n});\n```\n\nTo grant permissions to put messages in the input,\nyou can use the `grantWrite()` method:\n\n```ts\nimport * as iam from 'aws-cdk-lib/aws-iam';\nimport * as iotevents from '@aws-cdk/aws-iotevents-alpha';\n\ndeclare const grantable: iam.IGrantable;\nconst input = iotevents.Input.fromInputName(this, 'MyInput', 'my_input');\n\ninput.grantWrite(grantable);\n```\n"
|
|
2946
2959
|
},
|
|
2947
2960
|
"repository": {
|
|
2948
2961
|
"directory": "packages/individual-packages/aws-iotevents",
|
|
@@ -2980,6 +2993,82 @@
|
|
|
2980
2993
|
}
|
|
2981
2994
|
},
|
|
2982
2995
|
"types": {
|
|
2996
|
+
"@aws-cdk/aws-iotevents-alpha.ActionBindOptions": {
|
|
2997
|
+
"assembly": "@aws-cdk/aws-iotevents-alpha",
|
|
2998
|
+
"datatype": true,
|
|
2999
|
+
"docs": {
|
|
3000
|
+
"stability": "experimental",
|
|
3001
|
+
"summary": "Options when binding a Action to a detector model.",
|
|
3002
|
+
"example": "// The code below shows an example of how to instantiate this type.\n// The values are placeholders you should change.\nimport * as iotevents_alpha from '@aws-cdk/aws-iotevents-alpha';\nimport { aws_iam as iam } from 'aws-cdk-lib';\n\ndeclare const role: iam.Role;\nconst actionBindOptions: iotevents_alpha.ActionBindOptions = {\n role: role,\n};",
|
|
3003
|
+
"custom": {
|
|
3004
|
+
"exampleMetadata": "fixture=_generated"
|
|
3005
|
+
}
|
|
3006
|
+
},
|
|
3007
|
+
"fqn": "@aws-cdk/aws-iotevents-alpha.ActionBindOptions",
|
|
3008
|
+
"kind": "interface",
|
|
3009
|
+
"locationInModule": {
|
|
3010
|
+
"filename": "lib/action.ts",
|
|
3011
|
+
"line": 8
|
|
3012
|
+
},
|
|
3013
|
+
"name": "ActionBindOptions",
|
|
3014
|
+
"properties": [
|
|
3015
|
+
{
|
|
3016
|
+
"abstract": true,
|
|
3017
|
+
"docs": {
|
|
3018
|
+
"stability": "experimental",
|
|
3019
|
+
"summary": "The IAM role assumed by IoT Events to perform the action."
|
|
3020
|
+
},
|
|
3021
|
+
"immutable": true,
|
|
3022
|
+
"locationInModule": {
|
|
3023
|
+
"filename": "lib/action.ts",
|
|
3024
|
+
"line": 12
|
|
3025
|
+
},
|
|
3026
|
+
"name": "role",
|
|
3027
|
+
"type": {
|
|
3028
|
+
"fqn": "aws-cdk-lib.aws_iam.IRole"
|
|
3029
|
+
}
|
|
3030
|
+
}
|
|
3031
|
+
],
|
|
3032
|
+
"symbolId": "lib/action:ActionBindOptions"
|
|
3033
|
+
},
|
|
3034
|
+
"@aws-cdk/aws-iotevents-alpha.ActionConfig": {
|
|
3035
|
+
"assembly": "@aws-cdk/aws-iotevents-alpha",
|
|
3036
|
+
"datatype": true,
|
|
3037
|
+
"docs": {
|
|
3038
|
+
"stability": "experimental",
|
|
3039
|
+
"summary": "Properties for a AWS IoT Events action.",
|
|
3040
|
+
"example": "// The code below shows an example of how to instantiate this type.\n// The values are placeholders you should change.\nimport * as iotevents_alpha from '@aws-cdk/aws-iotevents-alpha';\nconst actionConfig: iotevents_alpha.ActionConfig = {\n configuration: {\n clearTimer: {\n timerName: 'timerName',\n },\n dynamoDb: {\n hashKeyField: 'hashKeyField',\n hashKeyValue: 'hashKeyValue',\n tableName: 'tableName',\n\n // the properties below are optional\n hashKeyType: 'hashKeyType',\n operation: 'operation',\n payload: {\n contentExpression: 'contentExpression',\n type: 'type',\n },\n payloadField: 'payloadField',\n rangeKeyField: 'rangeKeyField',\n rangeKeyType: 'rangeKeyType',\n rangeKeyValue: 'rangeKeyValue',\n },\n dynamoDBv2: {\n tableName: 'tableName',\n\n // the properties below are optional\n payload: {\n contentExpression: 'contentExpression',\n type: 'type',\n },\n },\n firehose: {\n deliveryStreamName: 'deliveryStreamName',\n\n // the properties below are optional\n payload: {\n contentExpression: 'contentExpression',\n type: 'type',\n },\n separator: 'separator',\n },\n iotEvents: {\n inputName: 'inputName',\n\n // the properties below are optional\n payload: {\n contentExpression: 'contentExpression',\n type: 'type',\n },\n },\n iotSiteWise: {\n propertyValue: {\n value: {\n booleanValue: 'booleanValue',\n doubleValue: 'doubleValue',\n integerValue: 'integerValue',\n stringValue: 'stringValue',\n },\n\n // the properties below are optional\n quality: 'quality',\n timestamp: {\n timeInSeconds: 'timeInSeconds',\n\n // the properties below are optional\n offsetInNanos: 'offsetInNanos',\n },\n },\n\n // the properties below are optional\n assetId: 'assetId',\n entryId: 'entryId',\n propertyAlias: 'propertyAlias',\n propertyId: 'propertyId',\n },\n iotTopicPublish: {\n mqttTopic: 'mqttTopic',\n\n // the properties below are optional\n payload: {\n contentExpression: 'contentExpression',\n type: 'type',\n },\n },\n lambda: {\n functionArn: 'functionArn',\n\n // the properties below are optional\n payload: {\n contentExpression: 'contentExpression',\n type: 'type',\n },\n },\n resetTimer: {\n timerName: 'timerName',\n },\n setTimer: {\n timerName: 'timerName',\n\n // the properties below are optional\n durationExpression: 'durationExpression',\n seconds: 123,\n },\n setVariable: {\n value: 'value',\n variableName: 'variableName',\n },\n sns: {\n targetArn: 'targetArn',\n\n // the properties below are optional\n payload: {\n contentExpression: 'contentExpression',\n type: 'type',\n },\n },\n sqs: {\n queueUrl: 'queueUrl',\n\n // the properties below are optional\n payload: {\n contentExpression: 'contentExpression',\n type: 'type',\n },\n useBase64: false,\n },\n },\n};",
|
|
3041
|
+
"custom": {
|
|
3042
|
+
"exampleMetadata": "fixture=_generated"
|
|
3043
|
+
}
|
|
3044
|
+
},
|
|
3045
|
+
"fqn": "@aws-cdk/aws-iotevents-alpha.ActionConfig",
|
|
3046
|
+
"kind": "interface",
|
|
3047
|
+
"locationInModule": {
|
|
3048
|
+
"filename": "lib/action.ts",
|
|
3049
|
+
"line": 28
|
|
3050
|
+
},
|
|
3051
|
+
"name": "ActionConfig",
|
|
3052
|
+
"properties": [
|
|
3053
|
+
{
|
|
3054
|
+
"abstract": true,
|
|
3055
|
+
"docs": {
|
|
3056
|
+
"stability": "experimental",
|
|
3057
|
+
"summary": "The configuration for this action."
|
|
3058
|
+
},
|
|
3059
|
+
"immutable": true,
|
|
3060
|
+
"locationInModule": {
|
|
3061
|
+
"filename": "lib/action.ts",
|
|
3062
|
+
"line": 32
|
|
3063
|
+
},
|
|
3064
|
+
"name": "configuration",
|
|
3065
|
+
"type": {
|
|
3066
|
+
"fqn": "aws-cdk-lib.aws_iotevents.CfnDetectorModel.ActionProperty"
|
|
3067
|
+
}
|
|
3068
|
+
}
|
|
3069
|
+
],
|
|
3070
|
+
"symbolId": "lib/action:ActionConfig"
|
|
3071
|
+
},
|
|
2983
3072
|
"@aws-cdk/aws-iotevents-alpha.DetectorModel": {
|
|
2984
3073
|
"assembly": "@aws-cdk/aws-iotevents-alpha",
|
|
2985
3074
|
"base": "aws-cdk-lib.Resource",
|
|
@@ -2987,7 +3076,7 @@
|
|
|
2987
3076
|
"custom": {
|
|
2988
3077
|
"exampleMetadata": "infused"
|
|
2989
3078
|
},
|
|
2990
|
-
"example": "import * as iotevents from '@aws-cdk/aws-iotevents-alpha';\n\nconst input = new iotevents.Input(this, 'MyInput', {\n inputName: 'my_input', // optional\n attributeJsonPaths: ['payload.deviceId', 'payload.temperature'],\n});\n\nconst warmState = new iotevents.State({\n stateName: 'warm',\n onEnter: [{\n eventName: 'test-event',\n condition: iotevents.Expression.currentInput(input),\n }],\n});\nconst coldState = new iotevents.State({\n stateName: 'cold',\n});\n\n// transit to coldState when temperature is 10\nwarmState.transitionTo(coldState, {\n eventName: 'to_coldState', // optional property, default by combining the names of the States\n when: iotevents.Expression.eq(\n iotevents.Expression.inputAttribute(input, 'payload.temperature'),\n iotevents.Expression.fromString('10'),\n ),\n});\n// transit to warmState when temperature is 20\ncoldState.transitionTo(warmState, {\n when: iotevents.Expression.eq(\n iotevents.Expression.inputAttribute(input, 'payload.temperature'),\n iotevents.Expression.fromString('20'),\n ),\n});\n\nnew iotevents.DetectorModel(this, 'MyDetectorModel', {\n detectorModelName: 'test-detector-model', // optional\n description: 'test-detector-model-description', // optional property, default is none\n evaluationMethod: iotevents.EventEvaluation.SERIAL, // optional property, default is iotevents.EventEvaluation.BATCH\n detectorKey: 'payload.deviceId', // optional property, default is none and single detector instance will be created and all inputs will be routed to it\n initialState: warmState,\n});",
|
|
3079
|
+
"example": "import * 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 func: lambda.IFunction;\n\nconst input = new iotevents.Input(this, 'MyInput', {\n inputName: 'my_input', // optional\n attributeJsonPaths: ['payload.deviceId', 'payload.temperature'],\n});\n\nconst warmState = new iotevents.State({\n stateName: 'warm',\n onEnter: [{\n eventName: 'test-enter-event',\n condition: iotevents.Expression.currentInput(input),\n actions: [new actions.LambdaInvokeAction(func)], // optional\n }],\n onInput: [{ // optional\n eventName: 'test-input-event',\n actions: [new actions.LambdaInvokeAction(func)],\n }],\n onExit: [{ // optional\n eventName: 'test-exit-event',\n actions: [new actions.LambdaInvokeAction(func)],\n }],\n});\nconst coldState = new iotevents.State({\n stateName: 'cold',\n});\n\n// transit to coldState when temperature is 10\nwarmState.transitionTo(coldState, {\n eventName: 'to_coldState', // optional property, default by combining the names of the States\n when: iotevents.Expression.eq(\n iotevents.Expression.inputAttribute(input, 'payload.temperature'),\n iotevents.Expression.fromString('10'),\n ),\n executing: [new actions.LambdaInvokeAction(func)], // optional\n});\n// transit to warmState when temperature is 20\ncoldState.transitionTo(warmState, {\n when: iotevents.Expression.eq(\n iotevents.Expression.inputAttribute(input, 'payload.temperature'),\n iotevents.Expression.fromString('20'),\n ),\n});\n\nnew iotevents.DetectorModel(this, 'MyDetectorModel', {\n detectorModelName: 'test-detector-model', // optional\n description: 'test-detector-model-description', // optional property, default is none\n evaluationMethod: iotevents.EventEvaluation.SERIAL, // optional property, default is iotevents.EventEvaluation.BATCH\n detectorKey: 'payload.deviceId', // optional property, default is none and single detector instance will be created and all inputs will be routed to it\n initialState: warmState,\n});",
|
|
2991
3080
|
"stability": "experimental",
|
|
2992
3081
|
"summary": "Defines an AWS IoT Events detector model in this stack."
|
|
2993
3082
|
},
|
|
@@ -3096,7 +3185,7 @@
|
|
|
3096
3185
|
"custom": {
|
|
3097
3186
|
"exampleMetadata": "infused"
|
|
3098
3187
|
},
|
|
3099
|
-
"example": "import * as iotevents from '@aws-cdk/aws-iotevents-alpha';\n\nconst input = new iotevents.Input(this, 'MyInput', {\n inputName: 'my_input', // optional\n attributeJsonPaths: ['payload.deviceId', 'payload.temperature'],\n});\n\nconst warmState = new iotevents.State({\n stateName: 'warm',\n onEnter: [{\n eventName: 'test-event',\n condition: iotevents.Expression.currentInput(input),\n }],\n});\nconst coldState = new iotevents.State({\n stateName: 'cold',\n});\n\n// transit to coldState when temperature is 10\nwarmState.transitionTo(coldState, {\n eventName: 'to_coldState', // optional property, default by combining the names of the States\n when: iotevents.Expression.eq(\n iotevents.Expression.inputAttribute(input, 'payload.temperature'),\n iotevents.Expression.fromString('10'),\n ),\n});\n// transit to warmState when temperature is 20\ncoldState.transitionTo(warmState, {\n when: iotevents.Expression.eq(\n iotevents.Expression.inputAttribute(input, 'payload.temperature'),\n iotevents.Expression.fromString('20'),\n ),\n});\n\nnew iotevents.DetectorModel(this, 'MyDetectorModel', {\n detectorModelName: 'test-detector-model', // optional\n description: 'test-detector-model-description', // optional property, default is none\n evaluationMethod: iotevents.EventEvaluation.SERIAL, // optional property, default is iotevents.EventEvaluation.BATCH\n detectorKey: 'payload.deviceId', // optional property, default is none and single detector instance will be created and all inputs will be routed to it\n initialState: warmState,\n});",
|
|
3188
|
+
"example": "import * 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 func: lambda.IFunction;\n\nconst input = new iotevents.Input(this, 'MyInput', {\n inputName: 'my_input', // optional\n attributeJsonPaths: ['payload.deviceId', 'payload.temperature'],\n});\n\nconst warmState = new iotevents.State({\n stateName: 'warm',\n onEnter: [{\n eventName: 'test-enter-event',\n condition: iotevents.Expression.currentInput(input),\n actions: [new actions.LambdaInvokeAction(func)], // optional\n }],\n onInput: [{ // optional\n eventName: 'test-input-event',\n actions: [new actions.LambdaInvokeAction(func)],\n }],\n onExit: [{ // optional\n eventName: 'test-exit-event',\n actions: [new actions.LambdaInvokeAction(func)],\n }],\n});\nconst coldState = new iotevents.State({\n stateName: 'cold',\n});\n\n// transit to coldState when temperature is 10\nwarmState.transitionTo(coldState, {\n eventName: 'to_coldState', // optional property, default by combining the names of the States\n when: iotevents.Expression.eq(\n iotevents.Expression.inputAttribute(input, 'payload.temperature'),\n iotevents.Expression.fromString('10'),\n ),\n executing: [new actions.LambdaInvokeAction(func)], // optional\n});\n// transit to warmState when temperature is 20\ncoldState.transitionTo(warmState, {\n when: iotevents.Expression.eq(\n iotevents.Expression.inputAttribute(input, 'payload.temperature'),\n iotevents.Expression.fromString('20'),\n ),\n});\n\nnew iotevents.DetectorModel(this, 'MyDetectorModel', {\n detectorModelName: 'test-detector-model', // optional\n description: 'test-detector-model-description', // optional property, default is none\n evaluationMethod: iotevents.EventEvaluation.SERIAL, // optional property, default is iotevents.EventEvaluation.BATCH\n detectorKey: 'payload.deviceId', // optional property, default is none and single detector instance will be created and all inputs will be routed to it\n initialState: warmState,\n});",
|
|
3100
3189
|
"stability": "experimental",
|
|
3101
3190
|
"summary": "Properties for defining an AWS IoT Events detector model."
|
|
3102
3191
|
},
|
|
@@ -3224,8 +3313,8 @@
|
|
|
3224
3313
|
"datatype": true,
|
|
3225
3314
|
"docs": {
|
|
3226
3315
|
"stability": "experimental",
|
|
3227
|
-
"summary": "Specifies the actions to be performed when the condition evaluates to
|
|
3228
|
-
"example": "// The code below shows an example of how to instantiate this type.\n// The values are placeholders you should change.\nimport * as iotevents_alpha from '@aws-cdk/aws-iotevents-alpha';\n\ndeclare const expression: iotevents_alpha.Expression;\nconst event: iotevents_alpha.Event = {\n eventName: 'eventName',\n\n // the properties below are optional\n condition: expression,\n};",
|
|
3316
|
+
"summary": "Specifies the actions to be performed when the condition evaluates to `true`.",
|
|
3317
|
+
"example": "// The code below shows an example of how to instantiate this type.\n// The values are placeholders you should change.\nimport * as iotevents_alpha from '@aws-cdk/aws-iotevents-alpha';\n\ndeclare const action: iotevents_alpha.IAction;\ndeclare const expression: iotevents_alpha.Expression;\nconst event: iotevents_alpha.Event = {\n eventName: 'eventName',\n\n // the properties below are optional\n actions: [action],\n condition: expression,\n};",
|
|
3229
3318
|
"custom": {
|
|
3230
3319
|
"exampleMetadata": "fixture=_generated"
|
|
3231
3320
|
}
|
|
@@ -3234,7 +3323,7 @@
|
|
|
3234
3323
|
"kind": "interface",
|
|
3235
3324
|
"locationInModule": {
|
|
3236
3325
|
"filename": "lib/event.ts",
|
|
3237
|
-
"line":
|
|
3326
|
+
"line": 7
|
|
3238
3327
|
},
|
|
3239
3328
|
"name": "Event",
|
|
3240
3329
|
"properties": [
|
|
@@ -3247,24 +3336,47 @@
|
|
|
3247
3336
|
"immutable": true,
|
|
3248
3337
|
"locationInModule": {
|
|
3249
3338
|
"filename": "lib/event.ts",
|
|
3250
|
-
"line":
|
|
3339
|
+
"line": 11
|
|
3251
3340
|
},
|
|
3252
3341
|
"name": "eventName",
|
|
3253
3342
|
"type": {
|
|
3254
3343
|
"primitive": "string"
|
|
3255
3344
|
}
|
|
3256
3345
|
},
|
|
3346
|
+
{
|
|
3347
|
+
"abstract": true,
|
|
3348
|
+
"docs": {
|
|
3349
|
+
"default": "- no actions will be performed",
|
|
3350
|
+
"stability": "experimental",
|
|
3351
|
+
"summary": "The actions to be performed."
|
|
3352
|
+
},
|
|
3353
|
+
"immutable": true,
|
|
3354
|
+
"locationInModule": {
|
|
3355
|
+
"filename": "lib/event.ts",
|
|
3356
|
+
"line": 25
|
|
3357
|
+
},
|
|
3358
|
+
"name": "actions",
|
|
3359
|
+
"optional": true,
|
|
3360
|
+
"type": {
|
|
3361
|
+
"collection": {
|
|
3362
|
+
"elementtype": {
|
|
3363
|
+
"fqn": "@aws-cdk/aws-iotevents-alpha.IAction"
|
|
3364
|
+
},
|
|
3365
|
+
"kind": "array"
|
|
3366
|
+
}
|
|
3367
|
+
}
|
|
3368
|
+
},
|
|
3257
3369
|
{
|
|
3258
3370
|
"abstract": true,
|
|
3259
3371
|
"docs": {
|
|
3260
3372
|
"default": "- none (the actions are always executed)",
|
|
3261
3373
|
"stability": "experimental",
|
|
3262
|
-
"summary": "The Boolean expression that, when
|
|
3374
|
+
"summary": "The Boolean expression that, when `true`, causes the actions to be performed."
|
|
3263
3375
|
},
|
|
3264
3376
|
"immutable": true,
|
|
3265
3377
|
"locationInModule": {
|
|
3266
3378
|
"filename": "lib/event.ts",
|
|
3267
|
-
"line":
|
|
3379
|
+
"line": 18
|
|
3268
3380
|
},
|
|
3269
3381
|
"name": "condition",
|
|
3270
3382
|
"optional": true,
|
|
@@ -3281,7 +3393,7 @@
|
|
|
3281
3393
|
"custom": {
|
|
3282
3394
|
"exampleMetadata": "infused"
|
|
3283
3395
|
},
|
|
3284
|
-
"example": "import * as iotevents from '@aws-cdk/aws-iotevents-alpha';\n\nconst input = new iotevents.Input(this, 'MyInput', {\n inputName: 'my_input', // optional\n attributeJsonPaths: ['payload.deviceId', 'payload.temperature'],\n});\n\nconst warmState = new iotevents.State({\n stateName: 'warm',\n onEnter: [{\n eventName: 'test-event',\n condition: iotevents.Expression.currentInput(input),\n }],\n});\nconst coldState = new iotevents.State({\n stateName: 'cold',\n});\n\n// transit to coldState when temperature is 10\nwarmState.transitionTo(coldState, {\n eventName: 'to_coldState', // optional property, default by combining the names of the States\n when: iotevents.Expression.eq(\n iotevents.Expression.inputAttribute(input, 'payload.temperature'),\n iotevents.Expression.fromString('10'),\n ),\n});\n// transit to warmState when temperature is 20\ncoldState.transitionTo(warmState, {\n when: iotevents.Expression.eq(\n iotevents.Expression.inputAttribute(input, 'payload.temperature'),\n iotevents.Expression.fromString('20'),\n ),\n});\n\nnew iotevents.DetectorModel(this, 'MyDetectorModel', {\n detectorModelName: 'test-detector-model', // optional\n description: 'test-detector-model-description', // optional property, default is none\n evaluationMethod: iotevents.EventEvaluation.SERIAL, // optional property, default is iotevents.EventEvaluation.BATCH\n detectorKey: 'payload.deviceId', // optional property, default is none and single detector instance will be created and all inputs will be routed to it\n initialState: warmState,\n});",
|
|
3396
|
+
"example": "import * 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 func: lambda.IFunction;\n\nconst input = new iotevents.Input(this, 'MyInput', {\n inputName: 'my_input', // optional\n attributeJsonPaths: ['payload.deviceId', 'payload.temperature'],\n});\n\nconst warmState = new iotevents.State({\n stateName: 'warm',\n onEnter: [{\n eventName: 'test-enter-event',\n condition: iotevents.Expression.currentInput(input),\n actions: [new actions.LambdaInvokeAction(func)], // optional\n }],\n onInput: [{ // optional\n eventName: 'test-input-event',\n actions: [new actions.LambdaInvokeAction(func)],\n }],\n onExit: [{ // optional\n eventName: 'test-exit-event',\n actions: [new actions.LambdaInvokeAction(func)],\n }],\n});\nconst coldState = new iotevents.State({\n stateName: 'cold',\n});\n\n// transit to coldState when temperature is 10\nwarmState.transitionTo(coldState, {\n eventName: 'to_coldState', // optional property, default by combining the names of the States\n when: iotevents.Expression.eq(\n iotevents.Expression.inputAttribute(input, 'payload.temperature'),\n iotevents.Expression.fromString('10'),\n ),\n executing: [new actions.LambdaInvokeAction(func)], // optional\n});\n// transit to warmState when temperature is 20\ncoldState.transitionTo(warmState, {\n when: iotevents.Expression.eq(\n iotevents.Expression.inputAttribute(input, 'payload.temperature'),\n iotevents.Expression.fromString('20'),\n ),\n});\n\nnew iotevents.DetectorModel(this, 'MyDetectorModel', {\n detectorModelName: 'test-detector-model', // optional\n description: 'test-detector-model-description', // optional property, default is none\n evaluationMethod: iotevents.EventEvaluation.SERIAL, // optional property, default is iotevents.EventEvaluation.BATCH\n detectorKey: 'payload.deviceId', // optional property, default is none and single detector instance will be created and all inputs will be routed to it\n initialState: warmState,\n});",
|
|
3285
3397
|
"stability": "experimental",
|
|
3286
3398
|
"summary": "Information about the order in which events are evaluated and how actions are executed."
|
|
3287
3399
|
},
|
|
@@ -3317,7 +3429,7 @@
|
|
|
3317
3429
|
"custom": {
|
|
3318
3430
|
"exampleMetadata": "infused"
|
|
3319
3431
|
},
|
|
3320
|
-
"example": "import * as iotevents from '@aws-cdk/aws-iotevents-alpha';\n\nconst input = new iotevents.Input(this, 'MyInput', {\n inputName: 'my_input', // optional\n attributeJsonPaths: ['payload.deviceId', 'payload.temperature'],\n});\n\nconst warmState = new iotevents.State({\n stateName: 'warm',\n onEnter: [{\n eventName: 'test-event',\n condition: iotevents.Expression.currentInput(input),\n }],\n});\nconst coldState = new iotevents.State({\n stateName: 'cold',\n});\n\n// transit to coldState when temperature is 10\nwarmState.transitionTo(coldState, {\n eventName: 'to_coldState', // optional property, default by combining the names of the States\n when: iotevents.Expression.eq(\n iotevents.Expression.inputAttribute(input, 'payload.temperature'),\n iotevents.Expression.fromString('10'),\n ),\n});\n// transit to warmState when temperature is 20\ncoldState.transitionTo(warmState, {\n when: iotevents.Expression.eq(\n iotevents.Expression.inputAttribute(input, 'payload.temperature'),\n iotevents.Expression.fromString('20'),\n ),\n});\n\nnew iotevents.DetectorModel(this, 'MyDetectorModel', {\n detectorModelName: 'test-detector-model', // optional\n description: 'test-detector-model-description', // optional property, default is none\n evaluationMethod: iotevents.EventEvaluation.SERIAL, // optional property, default is iotevents.EventEvaluation.BATCH\n detectorKey: 'payload.deviceId', // optional property, default is none and single detector instance will be created and all inputs will be routed to it\n initialState: warmState,\n});",
|
|
3432
|
+
"example": "import * 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 func: lambda.IFunction;\n\nconst input = new iotevents.Input(this, 'MyInput', {\n inputName: 'my_input', // optional\n attributeJsonPaths: ['payload.deviceId', 'payload.temperature'],\n});\n\nconst warmState = new iotevents.State({\n stateName: 'warm',\n onEnter: [{\n eventName: 'test-enter-event',\n condition: iotevents.Expression.currentInput(input),\n actions: [new actions.LambdaInvokeAction(func)], // optional\n }],\n onInput: [{ // optional\n eventName: 'test-input-event',\n actions: [new actions.LambdaInvokeAction(func)],\n }],\n onExit: [{ // optional\n eventName: 'test-exit-event',\n actions: [new actions.LambdaInvokeAction(func)],\n }],\n});\nconst coldState = new iotevents.State({\n stateName: 'cold',\n});\n\n// transit to coldState when temperature is 10\nwarmState.transitionTo(coldState, {\n eventName: 'to_coldState', // optional property, default by combining the names of the States\n when: iotevents.Expression.eq(\n iotevents.Expression.inputAttribute(input, 'payload.temperature'),\n iotevents.Expression.fromString('10'),\n ),\n executing: [new actions.LambdaInvokeAction(func)], // optional\n});\n// transit to warmState when temperature is 20\ncoldState.transitionTo(warmState, {\n when: iotevents.Expression.eq(\n iotevents.Expression.inputAttribute(input, 'payload.temperature'),\n iotevents.Expression.fromString('20'),\n ),\n});\n\nnew iotevents.DetectorModel(this, 'MyDetectorModel', {\n detectorModelName: 'test-detector-model', // optional\n description: 'test-detector-model-description', // optional property, default is none\n evaluationMethod: iotevents.EventEvaluation.SERIAL, // optional property, default is iotevents.EventEvaluation.BATCH\n detectorKey: 'payload.deviceId', // optional property, default is none and single detector instance will be created and all inputs will be routed to it\n initialState: warmState,\n});",
|
|
3321
3433
|
"see": "https://docs.aws.amazon.com/iotevents/latest/developerguide/iotevents-expressions.html",
|
|
3322
3434
|
"stability": "experimental",
|
|
3323
3435
|
"summary": "Expression for events in Detector Model state."
|
|
@@ -3503,6 +3615,54 @@
|
|
|
3503
3615
|
"name": "Expression",
|
|
3504
3616
|
"symbolId": "lib/expression:Expression"
|
|
3505
3617
|
},
|
|
3618
|
+
"@aws-cdk/aws-iotevents-alpha.IAction": {
|
|
3619
|
+
"assembly": "@aws-cdk/aws-iotevents-alpha",
|
|
3620
|
+
"docs": {
|
|
3621
|
+
"stability": "experimental",
|
|
3622
|
+
"summary": "An abstract action for DetectorModel."
|
|
3623
|
+
},
|
|
3624
|
+
"fqn": "@aws-cdk/aws-iotevents-alpha.IAction",
|
|
3625
|
+
"kind": "interface",
|
|
3626
|
+
"locationInModule": {
|
|
3627
|
+
"filename": "lib/action.ts",
|
|
3628
|
+
"line": 18
|
|
3629
|
+
},
|
|
3630
|
+
"methods": [
|
|
3631
|
+
{
|
|
3632
|
+
"abstract": true,
|
|
3633
|
+
"docs": {
|
|
3634
|
+
"stability": "experimental",
|
|
3635
|
+
"summary": "Returns the AWS IoT Events action specification."
|
|
3636
|
+
},
|
|
3637
|
+
"locationInModule": {
|
|
3638
|
+
"filename": "lib/action.ts",
|
|
3639
|
+
"line": 22
|
|
3640
|
+
},
|
|
3641
|
+
"name": "bind",
|
|
3642
|
+
"parameters": [
|
|
3643
|
+
{
|
|
3644
|
+
"name": "scope",
|
|
3645
|
+
"type": {
|
|
3646
|
+
"fqn": "constructs.Construct"
|
|
3647
|
+
}
|
|
3648
|
+
},
|
|
3649
|
+
{
|
|
3650
|
+
"name": "options",
|
|
3651
|
+
"type": {
|
|
3652
|
+
"fqn": "@aws-cdk/aws-iotevents-alpha.ActionBindOptions"
|
|
3653
|
+
}
|
|
3654
|
+
}
|
|
3655
|
+
],
|
|
3656
|
+
"returns": {
|
|
3657
|
+
"type": {
|
|
3658
|
+
"fqn": "@aws-cdk/aws-iotevents-alpha.ActionConfig"
|
|
3659
|
+
}
|
|
3660
|
+
}
|
|
3661
|
+
}
|
|
3662
|
+
],
|
|
3663
|
+
"name": "IAction",
|
|
3664
|
+
"symbolId": "lib/action:IAction"
|
|
3665
|
+
},
|
|
3506
3666
|
"@aws-cdk/aws-iotevents-alpha.IDetectorModel": {
|
|
3507
3667
|
"assembly": "@aws-cdk/aws-iotevents-alpha",
|
|
3508
3668
|
"docs": {
|
|
@@ -3676,7 +3836,7 @@
|
|
|
3676
3836
|
"custom": {
|
|
3677
3837
|
"exampleMetadata": "infused"
|
|
3678
3838
|
},
|
|
3679
|
-
"example": "import * as iotevents from '@aws-cdk/aws-iotevents-alpha';\n\nconst input = new iotevents.Input(this, 'MyInput', {\n inputName: 'my_input', // optional\n attributeJsonPaths: ['payload.deviceId', 'payload.temperature'],\n});\n\nconst warmState = new iotevents.State({\n stateName: 'warm',\n onEnter: [{\n eventName: 'test-event',\n condition: iotevents.Expression.currentInput(input),\n }],\n});\nconst coldState = new iotevents.State({\n stateName: 'cold',\n});\n\n// transit to coldState when temperature is 10\nwarmState.transitionTo(coldState, {\n eventName: 'to_coldState', // optional property, default by combining the names of the States\n when: iotevents.Expression.eq(\n iotevents.Expression.inputAttribute(input, 'payload.temperature'),\n iotevents.Expression.fromString('10'),\n ),\n});\n// transit to warmState when temperature is 20\ncoldState.transitionTo(warmState, {\n when: iotevents.Expression.eq(\n iotevents.Expression.inputAttribute(input, 'payload.temperature'),\n iotevents.Expression.fromString('20'),\n ),\n});\n\nnew iotevents.DetectorModel(this, 'MyDetectorModel', {\n detectorModelName: 'test-detector-model', // optional\n description: 'test-detector-model-description', // optional property, default is none\n evaluationMethod: iotevents.EventEvaluation.SERIAL, // optional property, default is iotevents.EventEvaluation.BATCH\n detectorKey: 'payload.deviceId', // optional property, default is none and single detector instance will be created and all inputs will be routed to it\n initialState: warmState,\n});",
|
|
3839
|
+
"example": "import * 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 func: lambda.IFunction;\n\nconst input = new iotevents.Input(this, 'MyInput', {\n inputName: 'my_input', // optional\n attributeJsonPaths: ['payload.deviceId', 'payload.temperature'],\n});\n\nconst warmState = new iotevents.State({\n stateName: 'warm',\n onEnter: [{\n eventName: 'test-enter-event',\n condition: iotevents.Expression.currentInput(input),\n actions: [new actions.LambdaInvokeAction(func)], // optional\n }],\n onInput: [{ // optional\n eventName: 'test-input-event',\n actions: [new actions.LambdaInvokeAction(func)],\n }],\n onExit: [{ // optional\n eventName: 'test-exit-event',\n actions: [new actions.LambdaInvokeAction(func)],\n }],\n});\nconst coldState = new iotevents.State({\n stateName: 'cold',\n});\n\n// transit to coldState when temperature is 10\nwarmState.transitionTo(coldState, {\n eventName: 'to_coldState', // optional property, default by combining the names of the States\n when: iotevents.Expression.eq(\n iotevents.Expression.inputAttribute(input, 'payload.temperature'),\n iotevents.Expression.fromString('10'),\n ),\n executing: [new actions.LambdaInvokeAction(func)], // optional\n});\n// transit to warmState when temperature is 20\ncoldState.transitionTo(warmState, {\n when: iotevents.Expression.eq(\n iotevents.Expression.inputAttribute(input, 'payload.temperature'),\n iotevents.Expression.fromString('20'),\n ),\n});\n\nnew iotevents.DetectorModel(this, 'MyDetectorModel', {\n detectorModelName: 'test-detector-model', // optional\n description: 'test-detector-model-description', // optional property, default is none\n evaluationMethod: iotevents.EventEvaluation.SERIAL, // optional property, default is iotevents.EventEvaluation.BATCH\n detectorKey: 'payload.deviceId', // optional property, default is none and single detector instance will be created and all inputs will be routed to it\n initialState: warmState,\n});",
|
|
3680
3840
|
"stability": "experimental",
|
|
3681
3841
|
"summary": "Defines an AWS IoT Events input in this stack."
|
|
3682
3842
|
},
|
|
@@ -3859,7 +4019,7 @@
|
|
|
3859
4019
|
"custom": {
|
|
3860
4020
|
"exampleMetadata": "infused"
|
|
3861
4021
|
},
|
|
3862
|
-
"example": "import * as iotevents from '@aws-cdk/aws-iotevents-alpha';\n\nconst input = new iotevents.Input(this, 'MyInput', {\n inputName: 'my_input', // optional\n attributeJsonPaths: ['payload.deviceId', 'payload.temperature'],\n});\n\nconst warmState = new iotevents.State({\n stateName: 'warm',\n onEnter: [{\n eventName: 'test-event',\n condition: iotevents.Expression.currentInput(input),\n }],\n});\nconst coldState = new iotevents.State({\n stateName: 'cold',\n});\n\n// transit to coldState when temperature is 10\nwarmState.transitionTo(coldState, {\n eventName: 'to_coldState', // optional property, default by combining the names of the States\n when: iotevents.Expression.eq(\n iotevents.Expression.inputAttribute(input, 'payload.temperature'),\n iotevents.Expression.fromString('10'),\n ),\n});\n// transit to warmState when temperature is 20\ncoldState.transitionTo(warmState, {\n when: iotevents.Expression.eq(\n iotevents.Expression.inputAttribute(input, 'payload.temperature'),\n iotevents.Expression.fromString('20'),\n ),\n});\n\nnew iotevents.DetectorModel(this, 'MyDetectorModel', {\n detectorModelName: 'test-detector-model', // optional\n description: 'test-detector-model-description', // optional property, default is none\n evaluationMethod: iotevents.EventEvaluation.SERIAL, // optional property, default is iotevents.EventEvaluation.BATCH\n detectorKey: 'payload.deviceId', // optional property, default is none and single detector instance will be created and all inputs will be routed to it\n initialState: warmState,\n});",
|
|
4022
|
+
"example": "import * 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 func: lambda.IFunction;\n\nconst input = new iotevents.Input(this, 'MyInput', {\n inputName: 'my_input', // optional\n attributeJsonPaths: ['payload.deviceId', 'payload.temperature'],\n});\n\nconst warmState = new iotevents.State({\n stateName: 'warm',\n onEnter: [{\n eventName: 'test-enter-event',\n condition: iotevents.Expression.currentInput(input),\n actions: [new actions.LambdaInvokeAction(func)], // optional\n }],\n onInput: [{ // optional\n eventName: 'test-input-event',\n actions: [new actions.LambdaInvokeAction(func)],\n }],\n onExit: [{ // optional\n eventName: 'test-exit-event',\n actions: [new actions.LambdaInvokeAction(func)],\n }],\n});\nconst coldState = new iotevents.State({\n stateName: 'cold',\n});\n\n// transit to coldState when temperature is 10\nwarmState.transitionTo(coldState, {\n eventName: 'to_coldState', // optional property, default by combining the names of the States\n when: iotevents.Expression.eq(\n iotevents.Expression.inputAttribute(input, 'payload.temperature'),\n iotevents.Expression.fromString('10'),\n ),\n executing: [new actions.LambdaInvokeAction(func)], // optional\n});\n// transit to warmState when temperature is 20\ncoldState.transitionTo(warmState, {\n when: iotevents.Expression.eq(\n iotevents.Expression.inputAttribute(input, 'payload.temperature'),\n iotevents.Expression.fromString('20'),\n ),\n});\n\nnew iotevents.DetectorModel(this, 'MyDetectorModel', {\n detectorModelName: 'test-detector-model', // optional\n description: 'test-detector-model-description', // optional property, default is none\n evaluationMethod: iotevents.EventEvaluation.SERIAL, // optional property, default is iotevents.EventEvaluation.BATCH\n detectorKey: 'payload.deviceId', // optional property, default is none and single detector instance will be created and all inputs will be routed to it\n initialState: warmState,\n});",
|
|
3863
4023
|
"stability": "experimental",
|
|
3864
4024
|
"summary": "Properties for defining an AWS IoT Events input."
|
|
3865
4025
|
},
|
|
@@ -3920,7 +4080,7 @@
|
|
|
3920
4080
|
"custom": {
|
|
3921
4081
|
"exampleMetadata": "infused"
|
|
3922
4082
|
},
|
|
3923
|
-
"example": "import * as iotevents from '@aws-cdk/aws-iotevents-alpha';\n\nconst input = new iotevents.Input(this, 'MyInput', {\n inputName: 'my_input', // optional\n attributeJsonPaths: ['payload.deviceId', 'payload.temperature'],\n});\n\nconst warmState = new iotevents.State({\n stateName: 'warm',\n onEnter: [{\n eventName: 'test-event',\n condition: iotevents.Expression.currentInput(input),\n }],\n});\nconst coldState = new iotevents.State({\n stateName: 'cold',\n});\n\n// transit to coldState when temperature is 10\nwarmState.transitionTo(coldState, {\n eventName: 'to_coldState', // optional property, default by combining the names of the States\n when: iotevents.Expression.eq(\n iotevents.Expression.inputAttribute(input, 'payload.temperature'),\n iotevents.Expression.fromString('10'),\n ),\n});\n// transit to warmState when temperature is 20\ncoldState.transitionTo(warmState, {\n when: iotevents.Expression.eq(\n iotevents.Expression.inputAttribute(input, 'payload.temperature'),\n iotevents.Expression.fromString('20'),\n ),\n});\n\nnew iotevents.DetectorModel(this, 'MyDetectorModel', {\n detectorModelName: 'test-detector-model', // optional\n description: 'test-detector-model-description', // optional property, default is none\n evaluationMethod: iotevents.EventEvaluation.SERIAL, // optional property, default is iotevents.EventEvaluation.BATCH\n detectorKey: 'payload.deviceId', // optional property, default is none and single detector instance will be created and all inputs will be routed to it\n initialState: warmState,\n});",
|
|
4083
|
+
"example": "import * 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 func: lambda.IFunction;\n\nconst input = new iotevents.Input(this, 'MyInput', {\n inputName: 'my_input', // optional\n attributeJsonPaths: ['payload.deviceId', 'payload.temperature'],\n});\n\nconst warmState = new iotevents.State({\n stateName: 'warm',\n onEnter: [{\n eventName: 'test-enter-event',\n condition: iotevents.Expression.currentInput(input),\n actions: [new actions.LambdaInvokeAction(func)], // optional\n }],\n onInput: [{ // optional\n eventName: 'test-input-event',\n actions: [new actions.LambdaInvokeAction(func)],\n }],\n onExit: [{ // optional\n eventName: 'test-exit-event',\n actions: [new actions.LambdaInvokeAction(func)],\n }],\n});\nconst coldState = new iotevents.State({\n stateName: 'cold',\n});\n\n// transit to coldState when temperature is 10\nwarmState.transitionTo(coldState, {\n eventName: 'to_coldState', // optional property, default by combining the names of the States\n when: iotevents.Expression.eq(\n iotevents.Expression.inputAttribute(input, 'payload.temperature'),\n iotevents.Expression.fromString('10'),\n ),\n executing: [new actions.LambdaInvokeAction(func)], // optional\n});\n// transit to warmState when temperature is 20\ncoldState.transitionTo(warmState, {\n when: iotevents.Expression.eq(\n iotevents.Expression.inputAttribute(input, 'payload.temperature'),\n iotevents.Expression.fromString('20'),\n ),\n});\n\nnew iotevents.DetectorModel(this, 'MyDetectorModel', {\n detectorModelName: 'test-detector-model', // optional\n description: 'test-detector-model-description', // optional property, default is none\n evaluationMethod: iotevents.EventEvaluation.SERIAL, // optional property, default is iotevents.EventEvaluation.BATCH\n detectorKey: 'payload.deviceId', // optional property, default is none and single detector instance will be created and all inputs will be routed to it\n initialState: warmState,\n});",
|
|
3924
4084
|
"stability": "experimental",
|
|
3925
4085
|
"summary": "Defines a state of a detector."
|
|
3926
4086
|
},
|
|
@@ -3931,7 +4091,7 @@
|
|
|
3931
4091
|
},
|
|
3932
4092
|
"locationInModule": {
|
|
3933
4093
|
"filename": "lib/state.ts",
|
|
3934
|
-
"line":
|
|
4094
|
+
"line": 104
|
|
3935
4095
|
},
|
|
3936
4096
|
"parameters": [
|
|
3937
4097
|
{
|
|
@@ -3945,18 +4105,18 @@
|
|
|
3945
4105
|
"kind": "class",
|
|
3946
4106
|
"locationInModule": {
|
|
3947
4107
|
"filename": "lib/state.ts",
|
|
3948
|
-
"line":
|
|
4108
|
+
"line": 96
|
|
3949
4109
|
},
|
|
3950
4110
|
"methods": [
|
|
3951
4111
|
{
|
|
3952
4112
|
"docs": {
|
|
3953
|
-
"remarks": "The transition event will be triggered if condition is evaluated to
|
|
4113
|
+
"remarks": "The transition event will be triggered if condition is evaluated to `true`.",
|
|
3954
4114
|
"stability": "experimental",
|
|
3955
4115
|
"summary": "Add a transition event to the state."
|
|
3956
4116
|
},
|
|
3957
4117
|
"locationInModule": {
|
|
3958
4118
|
"filename": "lib/state.ts",
|
|
3959
|
-
"line":
|
|
4119
|
+
"line": 115
|
|
3960
4120
|
},
|
|
3961
4121
|
"name": "transitionTo",
|
|
3962
4122
|
"parameters": [
|
|
@@ -3991,7 +4151,7 @@
|
|
|
3991
4151
|
"immutable": true,
|
|
3992
4152
|
"locationInModule": {
|
|
3993
4153
|
"filename": "lib/state.ts",
|
|
3994
|
-
"line":
|
|
4154
|
+
"line": 100
|
|
3995
4155
|
},
|
|
3996
4156
|
"name": "stateName",
|
|
3997
4157
|
"type": {
|
|
@@ -4008,7 +4168,7 @@
|
|
|
4008
4168
|
"custom": {
|
|
4009
4169
|
"exampleMetadata": "infused"
|
|
4010
4170
|
},
|
|
4011
|
-
"example": "import * as iotevents from '@aws-cdk/aws-iotevents-alpha';\n\nconst input = new iotevents.Input(this, 'MyInput', {\n inputName: 'my_input', // optional\n attributeJsonPaths: ['payload.deviceId', 'payload.temperature'],\n});\n\nconst warmState = new iotevents.State({\n stateName: 'warm',\n onEnter: [{\n eventName: 'test-event',\n condition: iotevents.Expression.currentInput(input),\n }],\n});\nconst coldState = new iotevents.State({\n stateName: 'cold',\n});\n\n// transit to coldState when temperature is 10\nwarmState.transitionTo(coldState, {\n eventName: 'to_coldState', // optional property, default by combining the names of the States\n when: iotevents.Expression.eq(\n iotevents.Expression.inputAttribute(input, 'payload.temperature'),\n iotevents.Expression.fromString('10'),\n ),\n});\n// transit to warmState when temperature is 20\ncoldState.transitionTo(warmState, {\n when: iotevents.Expression.eq(\n iotevents.Expression.inputAttribute(input, 'payload.temperature'),\n iotevents.Expression.fromString('20'),\n ),\n});\n\nnew iotevents.DetectorModel(this, 'MyDetectorModel', {\n detectorModelName: 'test-detector-model', // optional\n description: 'test-detector-model-description', // optional property, default is none\n evaluationMethod: iotevents.EventEvaluation.SERIAL, // optional property, default is iotevents.EventEvaluation.BATCH\n detectorKey: 'payload.deviceId', // optional property, default is none and single detector instance will be created and all inputs will be routed to it\n initialState: warmState,\n});",
|
|
4171
|
+
"example": "import * 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 func: lambda.IFunction;\n\nconst input = new iotevents.Input(this, 'MyInput', {\n inputName: 'my_input', // optional\n attributeJsonPaths: ['payload.deviceId', 'payload.temperature'],\n});\n\nconst warmState = new iotevents.State({\n stateName: 'warm',\n onEnter: [{\n eventName: 'test-enter-event',\n condition: iotevents.Expression.currentInput(input),\n actions: [new actions.LambdaInvokeAction(func)], // optional\n }],\n onInput: [{ // optional\n eventName: 'test-input-event',\n actions: [new actions.LambdaInvokeAction(func)],\n }],\n onExit: [{ // optional\n eventName: 'test-exit-event',\n actions: [new actions.LambdaInvokeAction(func)],\n }],\n});\nconst coldState = new iotevents.State({\n stateName: 'cold',\n});\n\n// transit to coldState when temperature is 10\nwarmState.transitionTo(coldState, {\n eventName: 'to_coldState', // optional property, default by combining the names of the States\n when: iotevents.Expression.eq(\n iotevents.Expression.inputAttribute(input, 'payload.temperature'),\n iotevents.Expression.fromString('10'),\n ),\n executing: [new actions.LambdaInvokeAction(func)], // optional\n});\n// transit to warmState when temperature is 20\ncoldState.transitionTo(warmState, {\n when: iotevents.Expression.eq(\n iotevents.Expression.inputAttribute(input, 'payload.temperature'),\n iotevents.Expression.fromString('20'),\n ),\n});\n\nnew iotevents.DetectorModel(this, 'MyDetectorModel', {\n detectorModelName: 'test-detector-model', // optional\n description: 'test-detector-model-description', // optional property, default is none\n evaluationMethod: iotevents.EventEvaluation.SERIAL, // optional property, default is iotevents.EventEvaluation.BATCH\n detectorKey: 'payload.deviceId', // optional property, default is none and single detector instance will be created and all inputs will be routed to it\n initialState: warmState,\n});",
|
|
4012
4172
|
"stability": "experimental",
|
|
4013
4173
|
"summary": "Properties for defining a state of a detector."
|
|
4014
4174
|
},
|
|
@@ -4016,7 +4176,7 @@
|
|
|
4016
4176
|
"kind": "interface",
|
|
4017
4177
|
"locationInModule": {
|
|
4018
4178
|
"filename": "lib/state.ts",
|
|
4019
|
-
"line":
|
|
4179
|
+
"line": 62
|
|
4020
4180
|
},
|
|
4021
4181
|
"name": "StateProps",
|
|
4022
4182
|
"properties": [
|
|
@@ -4029,7 +4189,7 @@
|
|
|
4029
4189
|
"immutable": true,
|
|
4030
4190
|
"locationInModule": {
|
|
4031
4191
|
"filename": "lib/state.ts",
|
|
4032
|
-
"line":
|
|
4192
|
+
"line": 66
|
|
4033
4193
|
},
|
|
4034
4194
|
"name": "stateName",
|
|
4035
4195
|
"type": {
|
|
@@ -4039,15 +4199,15 @@
|
|
|
4039
4199
|
{
|
|
4040
4200
|
"abstract": true,
|
|
4041
4201
|
"docs": {
|
|
4042
|
-
"default": "- events
|
|
4043
|
-
"remarks": "
|
|
4202
|
+
"default": "- no events will trigger on entering this state",
|
|
4203
|
+
"remarks": "The conditions of the events will be evaluated when entering this state.\nIf the condition of the event evaluates to `true`, the actions of the event will be executed.",
|
|
4044
4204
|
"stability": "experimental",
|
|
4045
4205
|
"summary": "Specifies the events on enter."
|
|
4046
4206
|
},
|
|
4047
4207
|
"immutable": true,
|
|
4048
4208
|
"locationInModule": {
|
|
4049
4209
|
"filename": "lib/state.ts",
|
|
4050
|
-
"line":
|
|
4210
|
+
"line": 74
|
|
4051
4211
|
},
|
|
4052
4212
|
"name": "onEnter",
|
|
4053
4213
|
"optional": true,
|
|
@@ -4059,6 +4219,54 @@
|
|
|
4059
4219
|
"kind": "array"
|
|
4060
4220
|
}
|
|
4061
4221
|
}
|
|
4222
|
+
},
|
|
4223
|
+
{
|
|
4224
|
+
"abstract": true,
|
|
4225
|
+
"docs": {
|
|
4226
|
+
"default": "- no events will trigger on exiting this state",
|
|
4227
|
+
"remarks": "The conditions of the events are evaluated when an exiting this state.\nIf the condition evaluates to `true`, the actions of the event will be executed.",
|
|
4228
|
+
"stability": "experimental",
|
|
4229
|
+
"summary": "Specifies the events on exit."
|
|
4230
|
+
},
|
|
4231
|
+
"immutable": true,
|
|
4232
|
+
"locationInModule": {
|
|
4233
|
+
"filename": "lib/state.ts",
|
|
4234
|
+
"line": 90
|
|
4235
|
+
},
|
|
4236
|
+
"name": "onExit",
|
|
4237
|
+
"optional": true,
|
|
4238
|
+
"type": {
|
|
4239
|
+
"collection": {
|
|
4240
|
+
"elementtype": {
|
|
4241
|
+
"fqn": "@aws-cdk/aws-iotevents-alpha.Event"
|
|
4242
|
+
},
|
|
4243
|
+
"kind": "array"
|
|
4244
|
+
}
|
|
4245
|
+
}
|
|
4246
|
+
},
|
|
4247
|
+
{
|
|
4248
|
+
"abstract": true,
|
|
4249
|
+
"docs": {
|
|
4250
|
+
"default": "- no events will trigger on input in this state",
|
|
4251
|
+
"remarks": "The conditions of the events will be evaluated when any input is received.\nIf the condition of the event evaluates to `true`, the actions of the event will be executed.",
|
|
4252
|
+
"stability": "experimental",
|
|
4253
|
+
"summary": "Specifies the events on input."
|
|
4254
|
+
},
|
|
4255
|
+
"immutable": true,
|
|
4256
|
+
"locationInModule": {
|
|
4257
|
+
"filename": "lib/state.ts",
|
|
4258
|
+
"line": 82
|
|
4259
|
+
},
|
|
4260
|
+
"name": "onInput",
|
|
4261
|
+
"optional": true,
|
|
4262
|
+
"type": {
|
|
4263
|
+
"collection": {
|
|
4264
|
+
"elementtype": {
|
|
4265
|
+
"fqn": "@aws-cdk/aws-iotevents-alpha.Event"
|
|
4266
|
+
},
|
|
4267
|
+
"kind": "array"
|
|
4268
|
+
}
|
|
4269
|
+
}
|
|
4062
4270
|
}
|
|
4063
4271
|
],
|
|
4064
4272
|
"symbolId": "lib/state:StateProps"
|
|
@@ -4070,7 +4278,7 @@
|
|
|
4070
4278
|
"custom": {
|
|
4071
4279
|
"exampleMetadata": "infused"
|
|
4072
4280
|
},
|
|
4073
|
-
"example": "import * as iotevents from '@aws-cdk/aws-iotevents-alpha';\n\nconst input = new iotevents.Input(this, 'MyInput', {\n inputName: 'my_input', // optional\n attributeJsonPaths: ['payload.deviceId', 'payload.temperature'],\n});\n\nconst warmState = new iotevents.State({\n stateName: 'warm',\n onEnter: [{\n eventName: 'test-event',\n condition: iotevents.Expression.currentInput(input),\n }],\n});\nconst coldState = new iotevents.State({\n stateName: 'cold',\n});\n\n// transit to coldState when temperature is 10\nwarmState.transitionTo(coldState, {\n eventName: 'to_coldState', // optional property, default by combining the names of the States\n when: iotevents.Expression.eq(\n iotevents.Expression.inputAttribute(input, 'payload.temperature'),\n iotevents.Expression.fromString('10'),\n ),\n});\n// transit to warmState when temperature is 20\ncoldState.transitionTo(warmState, {\n when: iotevents.Expression.eq(\n iotevents.Expression.inputAttribute(input, 'payload.temperature'),\n iotevents.Expression.fromString('20'),\n ),\n});\n\nnew iotevents.DetectorModel(this, 'MyDetectorModel', {\n detectorModelName: 'test-detector-model', // optional\n description: 'test-detector-model-description', // optional property, default is none\n evaluationMethod: iotevents.EventEvaluation.SERIAL, // optional property, default is iotevents.EventEvaluation.BATCH\n detectorKey: 'payload.deviceId', // optional property, default is none and single detector instance will be created and all inputs will be routed to it\n initialState: warmState,\n});",
|
|
4281
|
+
"example": "import * 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 func: lambda.IFunction;\n\nconst input = new iotevents.Input(this, 'MyInput', {\n inputName: 'my_input', // optional\n attributeJsonPaths: ['payload.deviceId', 'payload.temperature'],\n});\n\nconst warmState = new iotevents.State({\n stateName: 'warm',\n onEnter: [{\n eventName: 'test-enter-event',\n condition: iotevents.Expression.currentInput(input),\n actions: [new actions.LambdaInvokeAction(func)], // optional\n }],\n onInput: [{ // optional\n eventName: 'test-input-event',\n actions: [new actions.LambdaInvokeAction(func)],\n }],\n onExit: [{ // optional\n eventName: 'test-exit-event',\n actions: [new actions.LambdaInvokeAction(func)],\n }],\n});\nconst coldState = new iotevents.State({\n stateName: 'cold',\n});\n\n// transit to coldState when temperature is 10\nwarmState.transitionTo(coldState, {\n eventName: 'to_coldState', // optional property, default by combining the names of the States\n when: iotevents.Expression.eq(\n iotevents.Expression.inputAttribute(input, 'payload.temperature'),\n iotevents.Expression.fromString('10'),\n ),\n executing: [new actions.LambdaInvokeAction(func)], // optional\n});\n// transit to warmState when temperature is 20\ncoldState.transitionTo(warmState, {\n when: iotevents.Expression.eq(\n iotevents.Expression.inputAttribute(input, 'payload.temperature'),\n iotevents.Expression.fromString('20'),\n ),\n});\n\nnew iotevents.DetectorModel(this, 'MyDetectorModel', {\n detectorModelName: 'test-detector-model', // optional\n description: 'test-detector-model-description', // optional property, default is none\n evaluationMethod: iotevents.EventEvaluation.SERIAL, // optional property, default is iotevents.EventEvaluation.BATCH\n detectorKey: 'payload.deviceId', // optional property, default is none and single detector instance will be created and all inputs will be routed to it\n initialState: warmState,\n});",
|
|
4074
4282
|
"stability": "experimental",
|
|
4075
4283
|
"summary": "Properties for options of state transition."
|
|
4076
4284
|
},
|
|
@@ -4078,21 +4286,21 @@
|
|
|
4078
4286
|
"kind": "interface",
|
|
4079
4287
|
"locationInModule": {
|
|
4080
4288
|
"filename": "lib/state.ts",
|
|
4081
|
-
"line":
|
|
4289
|
+
"line": 10
|
|
4082
4290
|
},
|
|
4083
4291
|
"name": "TransitionOptions",
|
|
4084
4292
|
"properties": [
|
|
4085
4293
|
{
|
|
4086
4294
|
"abstract": true,
|
|
4087
4295
|
"docs": {
|
|
4088
|
-
"remarks": "When this was evaluated to
|
|
4296
|
+
"remarks": "When this was evaluated to `true`, the state transition and the actions are triggered.",
|
|
4089
4297
|
"stability": "experimental",
|
|
4090
4298
|
"summary": "The condition that is used to determine to cause the state transition and the actions."
|
|
4091
4299
|
},
|
|
4092
4300
|
"immutable": true,
|
|
4093
4301
|
"locationInModule": {
|
|
4094
4302
|
"filename": "lib/state.ts",
|
|
4095
|
-
"line":
|
|
4303
|
+
"line": 22
|
|
4096
4304
|
},
|
|
4097
4305
|
"name": "when",
|
|
4098
4306
|
"type": {
|
|
@@ -4109,18 +4317,41 @@
|
|
|
4109
4317
|
"immutable": true,
|
|
4110
4318
|
"locationInModule": {
|
|
4111
4319
|
"filename": "lib/state.ts",
|
|
4112
|
-
"line":
|
|
4320
|
+
"line": 16
|
|
4113
4321
|
},
|
|
4114
4322
|
"name": "eventName",
|
|
4115
4323
|
"optional": true,
|
|
4116
4324
|
"type": {
|
|
4117
4325
|
"primitive": "string"
|
|
4118
4326
|
}
|
|
4327
|
+
},
|
|
4328
|
+
{
|
|
4329
|
+
"abstract": true,
|
|
4330
|
+
"docs": {
|
|
4331
|
+
"default": "- no actions will be performed",
|
|
4332
|
+
"stability": "experimental",
|
|
4333
|
+
"summary": "The actions to be performed with the transition."
|
|
4334
|
+
},
|
|
4335
|
+
"immutable": true,
|
|
4336
|
+
"locationInModule": {
|
|
4337
|
+
"filename": "lib/state.ts",
|
|
4338
|
+
"line": 29
|
|
4339
|
+
},
|
|
4340
|
+
"name": "executing",
|
|
4341
|
+
"optional": true,
|
|
4342
|
+
"type": {
|
|
4343
|
+
"collection": {
|
|
4344
|
+
"elementtype": {
|
|
4345
|
+
"fqn": "@aws-cdk/aws-iotevents-alpha.IAction"
|
|
4346
|
+
},
|
|
4347
|
+
"kind": "array"
|
|
4348
|
+
}
|
|
4349
|
+
}
|
|
4119
4350
|
}
|
|
4120
4351
|
],
|
|
4121
4352
|
"symbolId": "lib/state:TransitionOptions"
|
|
4122
4353
|
}
|
|
4123
4354
|
},
|
|
4124
|
-
"version": "2.
|
|
4355
|
+
"version": "2.16.0-alpha.0",
|
|
4125
4356
|
"fingerprint": "**********"
|
|
4126
4357
|
}
|