@aws-cdk/aws-iotevents-alpha 2.14.0-alpha.0 → 2.17.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 +276 -32
- package/.jsii.tabl.json +389 -270
- 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 +7 -7
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.17.0",
|
|
12
12
|
"constructs": "^10.0.0"
|
|
13
13
|
},
|
|
14
14
|
"dependencyClosure": {
|
|
@@ -2043,6 +2043,19 @@
|
|
|
2043
2043
|
}
|
|
2044
2044
|
}
|
|
2045
2045
|
},
|
|
2046
|
+
"aws-cdk-lib.aws_personalize": {
|
|
2047
|
+
"targets": {
|
|
2048
|
+
"dotnet": {
|
|
2049
|
+
"namespace": "Amazon.CDK.AWS.Personalize"
|
|
2050
|
+
},
|
|
2051
|
+
"java": {
|
|
2052
|
+
"package": "software.amazon.awscdk.services.personalize"
|
|
2053
|
+
},
|
|
2054
|
+
"python": {
|
|
2055
|
+
"module": "aws_cdk.aws_personalize"
|
|
2056
|
+
}
|
|
2057
|
+
}
|
|
2058
|
+
},
|
|
2046
2059
|
"aws-cdk-lib.aws_pinpoint": {
|
|
2047
2060
|
"targets": {
|
|
2048
2061
|
"dotnet": {
|
|
@@ -2861,6 +2874,19 @@
|
|
|
2861
2874
|
"module": "aws_cdk.region_info"
|
|
2862
2875
|
}
|
|
2863
2876
|
}
|
|
2877
|
+
},
|
|
2878
|
+
"aws-cdk-lib.triggers": {
|
|
2879
|
+
"targets": {
|
|
2880
|
+
"dotnet": {
|
|
2881
|
+
"namespace": "Amazon.CDK.Triggers"
|
|
2882
|
+
},
|
|
2883
|
+
"java": {
|
|
2884
|
+
"package": "software.amazon.awscdk.triggers"
|
|
2885
|
+
},
|
|
2886
|
+
"python": {
|
|
2887
|
+
"module": "aws_cdk.triggers"
|
|
2888
|
+
}
|
|
2889
|
+
}
|
|
2864
2890
|
}
|
|
2865
2891
|
},
|
|
2866
2892
|
"targets": {
|
|
@@ -2942,7 +2968,7 @@
|
|
|
2942
2968
|
},
|
|
2943
2969
|
"name": "@aws-cdk/aws-iotevents-alpha",
|
|
2944
2970
|
"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"
|
|
2971
|
+
"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
2972
|
},
|
|
2947
2973
|
"repository": {
|
|
2948
2974
|
"directory": "packages/individual-packages/aws-iotevents",
|
|
@@ -2980,6 +3006,82 @@
|
|
|
2980
3006
|
}
|
|
2981
3007
|
},
|
|
2982
3008
|
"types": {
|
|
3009
|
+
"@aws-cdk/aws-iotevents-alpha.ActionBindOptions": {
|
|
3010
|
+
"assembly": "@aws-cdk/aws-iotevents-alpha",
|
|
3011
|
+
"datatype": true,
|
|
3012
|
+
"docs": {
|
|
3013
|
+
"stability": "experimental",
|
|
3014
|
+
"summary": "Options when binding a Action to a detector model.",
|
|
3015
|
+
"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};",
|
|
3016
|
+
"custom": {
|
|
3017
|
+
"exampleMetadata": "fixture=_generated"
|
|
3018
|
+
}
|
|
3019
|
+
},
|
|
3020
|
+
"fqn": "@aws-cdk/aws-iotevents-alpha.ActionBindOptions",
|
|
3021
|
+
"kind": "interface",
|
|
3022
|
+
"locationInModule": {
|
|
3023
|
+
"filename": "lib/action.ts",
|
|
3024
|
+
"line": 8
|
|
3025
|
+
},
|
|
3026
|
+
"name": "ActionBindOptions",
|
|
3027
|
+
"properties": [
|
|
3028
|
+
{
|
|
3029
|
+
"abstract": true,
|
|
3030
|
+
"docs": {
|
|
3031
|
+
"stability": "experimental",
|
|
3032
|
+
"summary": "The IAM role assumed by IoT Events to perform the action."
|
|
3033
|
+
},
|
|
3034
|
+
"immutable": true,
|
|
3035
|
+
"locationInModule": {
|
|
3036
|
+
"filename": "lib/action.ts",
|
|
3037
|
+
"line": 12
|
|
3038
|
+
},
|
|
3039
|
+
"name": "role",
|
|
3040
|
+
"type": {
|
|
3041
|
+
"fqn": "aws-cdk-lib.aws_iam.IRole"
|
|
3042
|
+
}
|
|
3043
|
+
}
|
|
3044
|
+
],
|
|
3045
|
+
"symbolId": "lib/action:ActionBindOptions"
|
|
3046
|
+
},
|
|
3047
|
+
"@aws-cdk/aws-iotevents-alpha.ActionConfig": {
|
|
3048
|
+
"assembly": "@aws-cdk/aws-iotevents-alpha",
|
|
3049
|
+
"datatype": true,
|
|
3050
|
+
"docs": {
|
|
3051
|
+
"stability": "experimental",
|
|
3052
|
+
"summary": "Properties for a AWS IoT Events action.",
|
|
3053
|
+
"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};",
|
|
3054
|
+
"custom": {
|
|
3055
|
+
"exampleMetadata": "fixture=_generated"
|
|
3056
|
+
}
|
|
3057
|
+
},
|
|
3058
|
+
"fqn": "@aws-cdk/aws-iotevents-alpha.ActionConfig",
|
|
3059
|
+
"kind": "interface",
|
|
3060
|
+
"locationInModule": {
|
|
3061
|
+
"filename": "lib/action.ts",
|
|
3062
|
+
"line": 28
|
|
3063
|
+
},
|
|
3064
|
+
"name": "ActionConfig",
|
|
3065
|
+
"properties": [
|
|
3066
|
+
{
|
|
3067
|
+
"abstract": true,
|
|
3068
|
+
"docs": {
|
|
3069
|
+
"stability": "experimental",
|
|
3070
|
+
"summary": "The configuration for this action."
|
|
3071
|
+
},
|
|
3072
|
+
"immutable": true,
|
|
3073
|
+
"locationInModule": {
|
|
3074
|
+
"filename": "lib/action.ts",
|
|
3075
|
+
"line": 32
|
|
3076
|
+
},
|
|
3077
|
+
"name": "configuration",
|
|
3078
|
+
"type": {
|
|
3079
|
+
"fqn": "aws-cdk-lib.aws_iotevents.CfnDetectorModel.ActionProperty"
|
|
3080
|
+
}
|
|
3081
|
+
}
|
|
3082
|
+
],
|
|
3083
|
+
"symbolId": "lib/action:ActionConfig"
|
|
3084
|
+
},
|
|
2983
3085
|
"@aws-cdk/aws-iotevents-alpha.DetectorModel": {
|
|
2984
3086
|
"assembly": "@aws-cdk/aws-iotevents-alpha",
|
|
2985
3087
|
"base": "aws-cdk-lib.Resource",
|
|
@@ -2987,7 +3089,7 @@
|
|
|
2987
3089
|
"custom": {
|
|
2988
3090
|
"exampleMetadata": "infused"
|
|
2989
3091
|
},
|
|
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});",
|
|
3092
|
+
"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
3093
|
"stability": "experimental",
|
|
2992
3094
|
"summary": "Defines an AWS IoT Events detector model in this stack."
|
|
2993
3095
|
},
|
|
@@ -3096,7 +3198,7 @@
|
|
|
3096
3198
|
"custom": {
|
|
3097
3199
|
"exampleMetadata": "infused"
|
|
3098
3200
|
},
|
|
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});",
|
|
3201
|
+
"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
3202
|
"stability": "experimental",
|
|
3101
3203
|
"summary": "Properties for defining an AWS IoT Events detector model."
|
|
3102
3204
|
},
|
|
@@ -3224,8 +3326,8 @@
|
|
|
3224
3326
|
"datatype": true,
|
|
3225
3327
|
"docs": {
|
|
3226
3328
|
"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};",
|
|
3329
|
+
"summary": "Specifies the actions to be performed when the condition evaluates to `true`.",
|
|
3330
|
+
"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
3331
|
"custom": {
|
|
3230
3332
|
"exampleMetadata": "fixture=_generated"
|
|
3231
3333
|
}
|
|
@@ -3234,7 +3336,7 @@
|
|
|
3234
3336
|
"kind": "interface",
|
|
3235
3337
|
"locationInModule": {
|
|
3236
3338
|
"filename": "lib/event.ts",
|
|
3237
|
-
"line":
|
|
3339
|
+
"line": 7
|
|
3238
3340
|
},
|
|
3239
3341
|
"name": "Event",
|
|
3240
3342
|
"properties": [
|
|
@@ -3247,24 +3349,47 @@
|
|
|
3247
3349
|
"immutable": true,
|
|
3248
3350
|
"locationInModule": {
|
|
3249
3351
|
"filename": "lib/event.ts",
|
|
3250
|
-
"line":
|
|
3352
|
+
"line": 11
|
|
3251
3353
|
},
|
|
3252
3354
|
"name": "eventName",
|
|
3253
3355
|
"type": {
|
|
3254
3356
|
"primitive": "string"
|
|
3255
3357
|
}
|
|
3256
3358
|
},
|
|
3359
|
+
{
|
|
3360
|
+
"abstract": true,
|
|
3361
|
+
"docs": {
|
|
3362
|
+
"default": "- no actions will be performed",
|
|
3363
|
+
"stability": "experimental",
|
|
3364
|
+
"summary": "The actions to be performed."
|
|
3365
|
+
},
|
|
3366
|
+
"immutable": true,
|
|
3367
|
+
"locationInModule": {
|
|
3368
|
+
"filename": "lib/event.ts",
|
|
3369
|
+
"line": 25
|
|
3370
|
+
},
|
|
3371
|
+
"name": "actions",
|
|
3372
|
+
"optional": true,
|
|
3373
|
+
"type": {
|
|
3374
|
+
"collection": {
|
|
3375
|
+
"elementtype": {
|
|
3376
|
+
"fqn": "@aws-cdk/aws-iotevents-alpha.IAction"
|
|
3377
|
+
},
|
|
3378
|
+
"kind": "array"
|
|
3379
|
+
}
|
|
3380
|
+
}
|
|
3381
|
+
},
|
|
3257
3382
|
{
|
|
3258
3383
|
"abstract": true,
|
|
3259
3384
|
"docs": {
|
|
3260
3385
|
"default": "- none (the actions are always executed)",
|
|
3261
3386
|
"stability": "experimental",
|
|
3262
|
-
"summary": "The Boolean expression that, when
|
|
3387
|
+
"summary": "The Boolean expression that, when `true`, causes the actions to be performed."
|
|
3263
3388
|
},
|
|
3264
3389
|
"immutable": true,
|
|
3265
3390
|
"locationInModule": {
|
|
3266
3391
|
"filename": "lib/event.ts",
|
|
3267
|
-
"line":
|
|
3392
|
+
"line": 18
|
|
3268
3393
|
},
|
|
3269
3394
|
"name": "condition",
|
|
3270
3395
|
"optional": true,
|
|
@@ -3281,7 +3406,7 @@
|
|
|
3281
3406
|
"custom": {
|
|
3282
3407
|
"exampleMetadata": "infused"
|
|
3283
3408
|
},
|
|
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});",
|
|
3409
|
+
"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
3410
|
"stability": "experimental",
|
|
3286
3411
|
"summary": "Information about the order in which events are evaluated and how actions are executed."
|
|
3287
3412
|
},
|
|
@@ -3317,7 +3442,7 @@
|
|
|
3317
3442
|
"custom": {
|
|
3318
3443
|
"exampleMetadata": "infused"
|
|
3319
3444
|
},
|
|
3320
|
-
"example": "import * as iotevents from '@aws-cdk/aws-iotevents-alpha';\
|
|
3445
|
+
"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});",
|
|
3321
3446
|
"see": "https://docs.aws.amazon.com/iotevents/latest/developerguide/iotevents-expressions.html",
|
|
3322
3447
|
"stability": "experimental",
|
|
3323
3448
|
"summary": "Expression for events in Detector Model state."
|
|
@@ -3503,6 +3628,54 @@
|
|
|
3503
3628
|
"name": "Expression",
|
|
3504
3629
|
"symbolId": "lib/expression:Expression"
|
|
3505
3630
|
},
|
|
3631
|
+
"@aws-cdk/aws-iotevents-alpha.IAction": {
|
|
3632
|
+
"assembly": "@aws-cdk/aws-iotevents-alpha",
|
|
3633
|
+
"docs": {
|
|
3634
|
+
"stability": "experimental",
|
|
3635
|
+
"summary": "An abstract action for DetectorModel."
|
|
3636
|
+
},
|
|
3637
|
+
"fqn": "@aws-cdk/aws-iotevents-alpha.IAction",
|
|
3638
|
+
"kind": "interface",
|
|
3639
|
+
"locationInModule": {
|
|
3640
|
+
"filename": "lib/action.ts",
|
|
3641
|
+
"line": 18
|
|
3642
|
+
},
|
|
3643
|
+
"methods": [
|
|
3644
|
+
{
|
|
3645
|
+
"abstract": true,
|
|
3646
|
+
"docs": {
|
|
3647
|
+
"stability": "experimental",
|
|
3648
|
+
"summary": "Returns the AWS IoT Events action specification."
|
|
3649
|
+
},
|
|
3650
|
+
"locationInModule": {
|
|
3651
|
+
"filename": "lib/action.ts",
|
|
3652
|
+
"line": 22
|
|
3653
|
+
},
|
|
3654
|
+
"name": "bind",
|
|
3655
|
+
"parameters": [
|
|
3656
|
+
{
|
|
3657
|
+
"name": "scope",
|
|
3658
|
+
"type": {
|
|
3659
|
+
"fqn": "constructs.Construct"
|
|
3660
|
+
}
|
|
3661
|
+
},
|
|
3662
|
+
{
|
|
3663
|
+
"name": "options",
|
|
3664
|
+
"type": {
|
|
3665
|
+
"fqn": "@aws-cdk/aws-iotevents-alpha.ActionBindOptions"
|
|
3666
|
+
}
|
|
3667
|
+
}
|
|
3668
|
+
],
|
|
3669
|
+
"returns": {
|
|
3670
|
+
"type": {
|
|
3671
|
+
"fqn": "@aws-cdk/aws-iotevents-alpha.ActionConfig"
|
|
3672
|
+
}
|
|
3673
|
+
}
|
|
3674
|
+
}
|
|
3675
|
+
],
|
|
3676
|
+
"name": "IAction",
|
|
3677
|
+
"symbolId": "lib/action:IAction"
|
|
3678
|
+
},
|
|
3506
3679
|
"@aws-cdk/aws-iotevents-alpha.IDetectorModel": {
|
|
3507
3680
|
"assembly": "@aws-cdk/aws-iotevents-alpha",
|
|
3508
3681
|
"docs": {
|
|
@@ -3676,7 +3849,7 @@
|
|
|
3676
3849
|
"custom": {
|
|
3677
3850
|
"exampleMetadata": "infused"
|
|
3678
3851
|
},
|
|
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});",
|
|
3852
|
+
"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
3853
|
"stability": "experimental",
|
|
3681
3854
|
"summary": "Defines an AWS IoT Events input in this stack."
|
|
3682
3855
|
},
|
|
@@ -3859,7 +4032,7 @@
|
|
|
3859
4032
|
"custom": {
|
|
3860
4033
|
"exampleMetadata": "infused"
|
|
3861
4034
|
},
|
|
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});",
|
|
4035
|
+
"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
4036
|
"stability": "experimental",
|
|
3864
4037
|
"summary": "Properties for defining an AWS IoT Events input."
|
|
3865
4038
|
},
|
|
@@ -3920,7 +4093,7 @@
|
|
|
3920
4093
|
"custom": {
|
|
3921
4094
|
"exampleMetadata": "infused"
|
|
3922
4095
|
},
|
|
3923
|
-
"example": "import * as iotevents from '@aws-cdk/aws-iotevents-alpha';\
|
|
4096
|
+
"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});",
|
|
3924
4097
|
"stability": "experimental",
|
|
3925
4098
|
"summary": "Defines a state of a detector."
|
|
3926
4099
|
},
|
|
@@ -3931,7 +4104,7 @@
|
|
|
3931
4104
|
},
|
|
3932
4105
|
"locationInModule": {
|
|
3933
4106
|
"filename": "lib/state.ts",
|
|
3934
|
-
"line":
|
|
4107
|
+
"line": 104
|
|
3935
4108
|
},
|
|
3936
4109
|
"parameters": [
|
|
3937
4110
|
{
|
|
@@ -3945,18 +4118,18 @@
|
|
|
3945
4118
|
"kind": "class",
|
|
3946
4119
|
"locationInModule": {
|
|
3947
4120
|
"filename": "lib/state.ts",
|
|
3948
|
-
"line":
|
|
4121
|
+
"line": 96
|
|
3949
4122
|
},
|
|
3950
4123
|
"methods": [
|
|
3951
4124
|
{
|
|
3952
4125
|
"docs": {
|
|
3953
|
-
"remarks": "The transition event will be triggered if condition is evaluated to
|
|
4126
|
+
"remarks": "The transition event will be triggered if condition is evaluated to `true`.",
|
|
3954
4127
|
"stability": "experimental",
|
|
3955
4128
|
"summary": "Add a transition event to the state."
|
|
3956
4129
|
},
|
|
3957
4130
|
"locationInModule": {
|
|
3958
4131
|
"filename": "lib/state.ts",
|
|
3959
|
-
"line":
|
|
4132
|
+
"line": 115
|
|
3960
4133
|
},
|
|
3961
4134
|
"name": "transitionTo",
|
|
3962
4135
|
"parameters": [
|
|
@@ -3991,7 +4164,7 @@
|
|
|
3991
4164
|
"immutable": true,
|
|
3992
4165
|
"locationInModule": {
|
|
3993
4166
|
"filename": "lib/state.ts",
|
|
3994
|
-
"line":
|
|
4167
|
+
"line": 100
|
|
3995
4168
|
},
|
|
3996
4169
|
"name": "stateName",
|
|
3997
4170
|
"type": {
|
|
@@ -4008,7 +4181,7 @@
|
|
|
4008
4181
|
"custom": {
|
|
4009
4182
|
"exampleMetadata": "infused"
|
|
4010
4183
|
},
|
|
4011
|
-
"example": "import * as iotevents from '@aws-cdk/aws-iotevents-alpha';\
|
|
4184
|
+
"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});",
|
|
4012
4185
|
"stability": "experimental",
|
|
4013
4186
|
"summary": "Properties for defining a state of a detector."
|
|
4014
4187
|
},
|
|
@@ -4016,7 +4189,7 @@
|
|
|
4016
4189
|
"kind": "interface",
|
|
4017
4190
|
"locationInModule": {
|
|
4018
4191
|
"filename": "lib/state.ts",
|
|
4019
|
-
"line":
|
|
4192
|
+
"line": 62
|
|
4020
4193
|
},
|
|
4021
4194
|
"name": "StateProps",
|
|
4022
4195
|
"properties": [
|
|
@@ -4029,7 +4202,7 @@
|
|
|
4029
4202
|
"immutable": true,
|
|
4030
4203
|
"locationInModule": {
|
|
4031
4204
|
"filename": "lib/state.ts",
|
|
4032
|
-
"line":
|
|
4205
|
+
"line": 66
|
|
4033
4206
|
},
|
|
4034
4207
|
"name": "stateName",
|
|
4035
4208
|
"type": {
|
|
@@ -4039,15 +4212,15 @@
|
|
|
4039
4212
|
{
|
|
4040
4213
|
"abstract": true,
|
|
4041
4214
|
"docs": {
|
|
4042
|
-
"default": "- events
|
|
4043
|
-
"remarks": "
|
|
4215
|
+
"default": "- no events will trigger on entering this state",
|
|
4216
|
+
"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
4217
|
"stability": "experimental",
|
|
4045
4218
|
"summary": "Specifies the events on enter."
|
|
4046
4219
|
},
|
|
4047
4220
|
"immutable": true,
|
|
4048
4221
|
"locationInModule": {
|
|
4049
4222
|
"filename": "lib/state.ts",
|
|
4050
|
-
"line":
|
|
4223
|
+
"line": 74
|
|
4051
4224
|
},
|
|
4052
4225
|
"name": "onEnter",
|
|
4053
4226
|
"optional": true,
|
|
@@ -4059,6 +4232,54 @@
|
|
|
4059
4232
|
"kind": "array"
|
|
4060
4233
|
}
|
|
4061
4234
|
}
|
|
4235
|
+
},
|
|
4236
|
+
{
|
|
4237
|
+
"abstract": true,
|
|
4238
|
+
"docs": {
|
|
4239
|
+
"default": "- no events will trigger on exiting this state",
|
|
4240
|
+
"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.",
|
|
4241
|
+
"stability": "experimental",
|
|
4242
|
+
"summary": "Specifies the events on exit."
|
|
4243
|
+
},
|
|
4244
|
+
"immutable": true,
|
|
4245
|
+
"locationInModule": {
|
|
4246
|
+
"filename": "lib/state.ts",
|
|
4247
|
+
"line": 90
|
|
4248
|
+
},
|
|
4249
|
+
"name": "onExit",
|
|
4250
|
+
"optional": true,
|
|
4251
|
+
"type": {
|
|
4252
|
+
"collection": {
|
|
4253
|
+
"elementtype": {
|
|
4254
|
+
"fqn": "@aws-cdk/aws-iotevents-alpha.Event"
|
|
4255
|
+
},
|
|
4256
|
+
"kind": "array"
|
|
4257
|
+
}
|
|
4258
|
+
}
|
|
4259
|
+
},
|
|
4260
|
+
{
|
|
4261
|
+
"abstract": true,
|
|
4262
|
+
"docs": {
|
|
4263
|
+
"default": "- no events will trigger on input in this state",
|
|
4264
|
+
"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.",
|
|
4265
|
+
"stability": "experimental",
|
|
4266
|
+
"summary": "Specifies the events on input."
|
|
4267
|
+
},
|
|
4268
|
+
"immutable": true,
|
|
4269
|
+
"locationInModule": {
|
|
4270
|
+
"filename": "lib/state.ts",
|
|
4271
|
+
"line": 82
|
|
4272
|
+
},
|
|
4273
|
+
"name": "onInput",
|
|
4274
|
+
"optional": true,
|
|
4275
|
+
"type": {
|
|
4276
|
+
"collection": {
|
|
4277
|
+
"elementtype": {
|
|
4278
|
+
"fqn": "@aws-cdk/aws-iotevents-alpha.Event"
|
|
4279
|
+
},
|
|
4280
|
+
"kind": "array"
|
|
4281
|
+
}
|
|
4282
|
+
}
|
|
4062
4283
|
}
|
|
4063
4284
|
],
|
|
4064
4285
|
"symbolId": "lib/state:StateProps"
|
|
@@ -4070,7 +4291,7 @@
|
|
|
4070
4291
|
"custom": {
|
|
4071
4292
|
"exampleMetadata": "infused"
|
|
4072
4293
|
},
|
|
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});",
|
|
4294
|
+
"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
4295
|
"stability": "experimental",
|
|
4075
4296
|
"summary": "Properties for options of state transition."
|
|
4076
4297
|
},
|
|
@@ -4078,21 +4299,21 @@
|
|
|
4078
4299
|
"kind": "interface",
|
|
4079
4300
|
"locationInModule": {
|
|
4080
4301
|
"filename": "lib/state.ts",
|
|
4081
|
-
"line":
|
|
4302
|
+
"line": 10
|
|
4082
4303
|
},
|
|
4083
4304
|
"name": "TransitionOptions",
|
|
4084
4305
|
"properties": [
|
|
4085
4306
|
{
|
|
4086
4307
|
"abstract": true,
|
|
4087
4308
|
"docs": {
|
|
4088
|
-
"remarks": "When this was evaluated to
|
|
4309
|
+
"remarks": "When this was evaluated to `true`, the state transition and the actions are triggered.",
|
|
4089
4310
|
"stability": "experimental",
|
|
4090
4311
|
"summary": "The condition that is used to determine to cause the state transition and the actions."
|
|
4091
4312
|
},
|
|
4092
4313
|
"immutable": true,
|
|
4093
4314
|
"locationInModule": {
|
|
4094
4315
|
"filename": "lib/state.ts",
|
|
4095
|
-
"line":
|
|
4316
|
+
"line": 22
|
|
4096
4317
|
},
|
|
4097
4318
|
"name": "when",
|
|
4098
4319
|
"type": {
|
|
@@ -4109,18 +4330,41 @@
|
|
|
4109
4330
|
"immutable": true,
|
|
4110
4331
|
"locationInModule": {
|
|
4111
4332
|
"filename": "lib/state.ts",
|
|
4112
|
-
"line":
|
|
4333
|
+
"line": 16
|
|
4113
4334
|
},
|
|
4114
4335
|
"name": "eventName",
|
|
4115
4336
|
"optional": true,
|
|
4116
4337
|
"type": {
|
|
4117
4338
|
"primitive": "string"
|
|
4118
4339
|
}
|
|
4340
|
+
},
|
|
4341
|
+
{
|
|
4342
|
+
"abstract": true,
|
|
4343
|
+
"docs": {
|
|
4344
|
+
"default": "- no actions will be performed",
|
|
4345
|
+
"stability": "experimental",
|
|
4346
|
+
"summary": "The actions to be performed with the transition."
|
|
4347
|
+
},
|
|
4348
|
+
"immutable": true,
|
|
4349
|
+
"locationInModule": {
|
|
4350
|
+
"filename": "lib/state.ts",
|
|
4351
|
+
"line": 29
|
|
4352
|
+
},
|
|
4353
|
+
"name": "executing",
|
|
4354
|
+
"optional": true,
|
|
4355
|
+
"type": {
|
|
4356
|
+
"collection": {
|
|
4357
|
+
"elementtype": {
|
|
4358
|
+
"fqn": "@aws-cdk/aws-iotevents-alpha.IAction"
|
|
4359
|
+
},
|
|
4360
|
+
"kind": "array"
|
|
4361
|
+
}
|
|
4362
|
+
}
|
|
4119
4363
|
}
|
|
4120
4364
|
],
|
|
4121
4365
|
"symbolId": "lib/state:TransitionOptions"
|
|
4122
4366
|
}
|
|
4123
4367
|
},
|
|
4124
|
-
"version": "2.
|
|
4368
|
+
"version": "2.17.0-alpha.0",
|
|
4125
4369
|
"fingerprint": "**********"
|
|
4126
4370
|
}
|