aws / aws-step-functions-data-science-sdk-python

Step Functions Data Science SDK for building machine learning (ML) workflows and pipelines on AWS
Apache License 2.0
285 stars 87 forks source link

Stepfunctions-Textract-StartDocumentTextDetection does not accept SNSTopicArn in NotificationChannel #198

Closed fanick1 closed 1 year ago

fanick1 commented 1 year ago

I think there must be some validation error on the backend of step function schema validation when validating NotificationChannel parameter on async Textract operations such as StartDocumentTextDetection.

According to the documentation https://docs.aws.amazon.com/textract/latest/dg/API_StartDocumentTextDetection.html the operation takes parameter SNSTopicArn (absolutely crucial param) but this parameter can't be configured when we try to integrate it as a step in a step function.

On save the step function gets validated and validation error shows up:

The field "SNSTopicArn" is not supported by Step Functions /States/StartDocumentTextDetection/Parameters 
For more information, see Amazon States Language 

This basically disqualifies Textract with its async invocated operations from use in step functions. Workaround is probably to launch it from lambda function step.

Reproduction Steps

Create step function via aws console with this content:

{
  "StartAt": "StartDocumentTextDetection",
  "States": {
    "": {
      "Type": "Task",
      "Parameters": {
        "DocumentLocation": {},
        "NotificationChannel": {
          "RoleArn": "string",
          "SNSTopicArn": "string"
        }
      },
      "Resource": "arn:aws:states:::aws-sdk:textract:startDocumentTextDetection",
      "End": true
    }
  }
}

What did you expect to happen?

step function gets successfuly saved

What actually happened?

On save the step function gets validated and validation error shows up:

The field "SNSTopicArn" is not supported by Step Functions /States/StartDocumentTextDetection/Parameters 
For more information, see Amazon States Language 

Environment

Other


This is :bug: Bug Report

fanick1 commented 1 year ago

Ok, it's not a bug, the SNSTopicArn must be spelled out in pascal case - SnsTopicArn