AWS Step Functions integration with Amazon Comprehend using Terraform

AWS Step Functions → Amazon Comprehend

The Terraform template deploys an AWS Step Functions workflow with Amazon Comprehend and returns the sentiment analysis done by Amazon Comprehend.

Start the Express Workflow using the start-sync-execution api command with a message string in English for sentiment analysis in the input payload.
The Express Workflow invokes Amazon Comprehend.
Comprehend returns the sentiment of the input text.
If the integration works fine, the sentiment analysis outcome is returned in Step Function execution results within a output object.
If the integration fails, the Step Functions workflow will retry up to 5 times before exiting with a status:FAILED response.

< Back to all patterns

GitHub icon Download this pattern (.zip)

GitHub icon View this pattern on GitHub


Clone repo

git clone https://github.com/aws-samples/serverless-patterns/cd serverless-patterns/sfn-comprehend-terraform

Deploy

terraform initterraform apply --auto-approve


Testing

See the GitHub repo for detailed testing instructions.

Cleanup

terraform destroy --auto-approve

Created by:

Rahul Sringeri

Rahul Sringeri

Technical Account Manager at AWS for Strategic Accounts