You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: sfn-comprehend-terraform/README.md
+29-14Lines changed: 29 additions & 14 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,4 +1,4 @@
1
-
# AWS Step Functions Integration with Amazon Comprehend for Sentiment Analysis
1
+
# AWS Step Functions integration with Amazon Comprehend using terraform
2
2
3
3
The AWS Step Functions Express Workflow can be started using the AWS CLI or from another service (e.g. Amazon API Gateway) to run an express workflow and return the result.
4
4
@@ -36,7 +36,7 @@ Important: this application uses various AWS services and there are costs associ
36
36
37
37
## How it works
38
38
39
-
* Start the Express Workflow using the `start-sync-execution` api command with a "message" string in English for sentiment analysis in the input payload.
39
+
* Start the Standard Workflow using the `start-execution` api command with a "message" string in English for sentiment analysis in the input payload.
40
40
* The Express Workflow invokes Amazon Comprehend.
41
41
* Amazon Comprehend returns the sentiment of the input text.
42
42
* If the integration works fine, the sentiment analysis outcome is returned in Step Function execution results within a `output` object
@@ -49,34 +49,49 @@ Please refer to the architecture diagram below:
49
49
50
50
## Testing
51
51
52
-
Run the following AWS CLI command to send a 'start-sync-execution` comand to start the AWS Step Functions workflow. Note, you must edit the {StateMachineExpressSyncToComprehend} placeholder with the ARN of the deployed AWS Step Functions workflow. This is provided in the stack outputs.
52
+
Run the following AWS CLI command to send a 'start-execution' command to start the AWS Step Functions workflow. Note, you must edit the <StateMachineArn> placeholder with the ARN of the deployed AWS Step Functions workflow. This is provided in the stack outputs.
53
53
54
54
```bash
55
-
aws stepfunctions start-sync-execution --name "test" --state-machine-arn "{StateMachineExpressSyncToComprehend}" --input "{\"message\":\"I am very happy today.\"}"
55
+
aws stepfunctions start-execution \
56
+
--state-machine-arn <StateMachineArn> \
57
+
--input '{"message":"I am very happy today."}'
58
+
```
59
+
60
+
After running the above command, the exection ARN will be displayed as follows -
"input": "{\"message\":\"I am very happy today.\"}",
69
85
"inputDetails": {
70
86
"included": true
71
87
},
72
-
"output": "{\"message\":\"I am very happy today.\",\"Sentiment\":{\"Sentiment\":\"POSITIVE\",\"SentimentScore\":{\"Mixed\":1.4907288E-4,\"Negative\":1.3237515E-4,\"Neutral\":3.8026855E-4,\"Positive\":0.9993383}}}",
88
+
"output": "{\"message\":\"I am very happy today.\",\"Sentiment\":{\"Sentiment\":\"POSITIVE\",\"SentimentScore\":{\"Mixed\":6.753839E-4,\"Negative\":5.647173E-4,\"Neutral\":0.0011139456,\"Positive\":0.99764603}}}",
73
89
"outputDetails": {
74
90
"included": true
75
91
},
76
-
"billingDetails": {
77
-
"billedMemoryUsedInMB": 64,
78
-
"billedDurationInMilliseconds": 200
79
-
}
92
+
"redriveCount": 0,
93
+
"redriveStatus": "NOT_REDRIVABLE",
94
+
"redriveStatusReason": "Execution is SUCCEEDED and cannot be redriven"
0 commit comments