AWSTemplateFormatVersion: '2010-09-09' Description: "(SO0042) - aws-content-analysis. Workflow to run image analyses." Parameters: WorkflowCustomResourceArn: Type: String Description: "ARN of the Media Insights custom resource that handles creating operations, stages and workflows" OperatorLibraryStack: Description: "Name of the MIE operator library stack" Type: String Resources: # Stages ValidationStage: Type: Custom::CustomResource Properties: ServiceToken: !Ref WorkflowCustomResourceArn ResourceType: "Stage" Name: "ValidationStage" Operations: - Fn::ImportValue: Fn::Sub: "${OperatorLibraryStack}:MediainfoImage" parallelRekognitionStage: Type: Custom::CustomResource Properties: ServiceToken: !Ref WorkflowCustomResourceArn ResourceType: "Stage" Name: "parallelRekognitionStage" Operations: - Fn::ImportValue: Fn::Sub: "${OperatorLibraryStack}:CelebRecognition" - Fn::ImportValue: Fn::Sub: "${OperatorLibraryStack}:ContentModeration" - Fn::ImportValue: Fn::Sub: "${OperatorLibraryStack}:FaceDetection" - Fn::ImportValue: Fn::Sub: "${OperatorLibraryStack}:FaceSearch" - Fn::ImportValue: Fn::Sub: "${OperatorLibraryStack}:LabelDetection" - Fn::ImportValue: Fn::Sub: "${OperatorLibraryStack}:TextDetectionImage" - Fn::ImportValue: Fn::Sub: "${OperatorLibraryStack}:PersonTracking" # Face search operation requires a custom input without any pre-existing default so it has a prerequiste step to create a collection # to search against. This workflow should run without any pre-requisite step. RekognitionVideoNoFaceSearchStage: Type: Custom::CustomResource Properties: ServiceToken: !Ref WorkflowCustomResourceArn ResourceType: "Stage" Name: "RekognitionVideoNoFaceSearchStage" Operations: - Fn::ImportValue: Fn::Sub: "${OperatorLibraryStack}:LabelDetection" - Fn::ImportValue: Fn::Sub: "${OperatorLibraryStack}:PersonTracking" - Fn::ImportValue: Fn::Sub: "${OperatorLibraryStack}:CelebRecognition" - Fn::ImportValue: Fn::Sub: "${OperatorLibraryStack}:ContentModeration" - Fn::ImportValue: Fn::Sub: "${OperatorLibraryStack}:FaceDetection" RekognitionStage: Type: Custom::CustomResource Properties: ServiceToken: !Ref WorkflowCustomResourceArn ResourceType: "Stage" Name: "RekognitionStage" Operations: - Fn::ImportValue: Fn::Sub: "${OperatorLibraryStack}:CelebRecognitionImage" - Fn::ImportValue: Fn::Sub: "${OperatorLibraryStack}:ContentModerationImage" - Fn::ImportValue: Fn::Sub: "${OperatorLibraryStack}:FaceDetectionImage" - Fn::ImportValue: Fn::Sub: "${OperatorLibraryStack}:FaceSearchImage" - Fn::ImportValue: Fn::Sub: "${OperatorLibraryStack}:LabelDetectionImage" - Fn::ImportValue: Fn::Sub: "${OperatorLibraryStack}:TextDetectionImage" # Face search operation requires a custom input without any pre-existing default so it has a prerequiste step to create a collection # to search against. This workflow should run without any pre-requisite step. RekognitionImageNoFaceSearchStage: Type: Custom::CustomResource Properties: ServiceToken: !Ref WorkflowCustomResourceArn ResourceType: "Stage" Name: "RekognitionImageNoFaceSearchStage" Operations: - Fn::ImportValue: Fn::Sub: "${OperatorLibraryStack}:CelebRecognitionImage" - Fn::ImportValue: Fn::Sub: "${OperatorLibraryStack}:ContentModerationImage" - Fn::ImportValue: Fn::Sub: "${OperatorLibraryStack}:FaceDetectionImage" - Fn::ImportValue: Fn::Sub: "${OperatorLibraryStack}:LabelDetectionImage" - Fn::ImportValue: Fn::Sub: "${OperatorLibraryStack}:TextDetectionImage" # Workflows CasImageWorkflow: DependsOn: - ValidationStage - RekognitionStage Type: Custom::CustomResource Properties: ServiceToken: !Ref WorkflowCustomResourceArn ResourceType: "Workflow" Name: "CasImageWorkflow" StartAt: !GetAtt ValidationStage.Name Stages: !Sub - |- { "${ValidationStage}":{ "Next": "${rekognitionSuite}" }, "${rekognitionSuite}":{ "End": true } } - { ValidationStage: !GetAtt ValidationStage.Name, rekognitionSuite: !GetAtt RekognitionStage.Name }