cfn/classification_pipeline.yaml [723:837]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
                            ]
                        },
                        "RoleArn": "arn:aws:iam::${AWS::AccountId}:role/service-role/AmazonSageMaker-ExecutionRole-TrainingInferencePipeline",
                        "ProcessingResources": {
                            "ClusterConfig": {
                                "InstanceCount": 1,
                                "InstanceType": "ml.m5.xlarge",
                                "VolumeSizeInGB": 30
                            }
                        },
                        "StoppingCondition": {
                            "MaxRuntimeInSeconds": 1200
                        }
                    },
                    "Type": "Task",
                    "End": true,
                    "Catch": [
                        {
                            "ErrorEquals": [
                                "States.TaskFailed"
                            ],
                            "Next": "ML Workflow failed"
                        }
                    ]
                },
                "ML Workflow failed": {
                    "Cause": "SageMakerProcessingJobFailed",
                    "Type": "Fail"
                }
            }
          }
        - {
            XgbImageID:
              !FindInMap [
                AWSRegionArch2XGBoostImageRegistry,
                !Ref "AWS::Region",
                id,
              ],
            DebuggerImageId:
              !FindInMap [
                AWSRegionArch2DebuggerImageRegistry,
                !Ref "AWS::Region",
                id,
              ],
          }
      RoleArn: !GetAtt IAMRoleStepFunction.Arn
      StateMachineType: "STANDARD"
      LoggingConfiguration:
        # Destinations:
        # - CloudWatchLogsLogGroup:
        # LogGroupArn: !Sub "arn:aws:logs:${AWS::Region}:${AWS::AccountId}:log-group:/aws/vendedlogs/states/SageMakerProcessTrainWorkflow-Log:*"
        IncludeExecutionData: true
        Level: "OFF"

  StepFunctionsStateMachineInference:
    Type: "AWS::StepFunctions::StateMachine"
    Properties:
      StateMachineName: "SageMakerPreproInferWorkflow"
      DefinitionString: !Sub
        - |
          {
            "StartAt": "SageMaker Inference Step Preprocessing",
            "States": {
                "SageMaker Inference Step Preprocessing": {
                    "Resource": "arn:aws:states:::sagemaker:createProcessingJob.sync",
                    "Parameters": {
                        "ProcessingJobName.$": "$$.Execution.Input['PreprocessingJobName']",
                        "ProcessingInputs": [
                            {
                                "InputName": "code",
                                "AppManaged": false,
                                "S3Input": {
                                    "S3Uri": "s3://${PipelineBucketName}/script/inferpreprocessing.py",
                                    "LocalPath": "/opt/ml/processing/input/code",
                                    "S3DataType": "S3Prefix",
                                    "S3InputMode": "File",
                                    "S3DataDistributionType": "FullyReplicated",
                                    "S3CompressionType": "None"
                                }
                            },
                            {
                                "InputName": "processing_joblib",
                                "AppManaged": false,
                                "S3Input": {
                                    "S3Uri": "s3://${PipelineBucketName}/model/preprocessor/preprocessor.joblib",
                                    "LocalPath": "/opt/ml/processing/transformer",
                                    "S3DataType": "S3Prefix",
                                    "S3InputMode": "File",
                                    "S3DataDistributionType": "FullyReplicated",
                                    "S3CompressionType": "None"
                                }
                            }
                        ],
                        "ProcessingOutputConfig": {
                            "Outputs": [
                                {
                                    "OutputName": "infer_data",
                                    "AppManaged": false,
                                    "S3Output": {
                                        "S3Uri": "s3://${PipelineBucketName}/data/intermediate/infer_data",
                                        "LocalPath": "/opt/ml/processing/infer",
                                        "S3UploadMode": "EndOfJob"
                                    }
                                }
                            ]
                        },
                        "AppSpecification": {
                            "ImageUri": "${XgbImageID}.dkr.ecr.${AWS::Region}.amazonaws.com/sagemaker-scikit-learn:0.20.0-cpu-py3",
                            "ContainerArguments": [
                                "--database",
                                "${AthenaDatabaseName}",
                                "--region",
                                "${AWS::Region}",
                                "--table",
                                "infer",
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



cfn/time_to_event_pipeline.yaml [724:838]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
                            ]
                        },
                        "RoleArn": "arn:aws:iam::${AWS::AccountId}:role/service-role/AmazonSageMaker-ExecutionRole-TrainingInferencePipeline",
                        "ProcessingResources": {
                            "ClusterConfig": {
                                "InstanceCount": 1,
                                "InstanceType": "ml.m5.xlarge",
                                "VolumeSizeInGB": 30
                            }
                        },
                        "StoppingCondition": {
                            "MaxRuntimeInSeconds": 1200
                        }
                    },
                    "Type": "Task",
                    "End": true,
                    "Catch": [
                        {
                            "ErrorEquals": [
                                "States.TaskFailed"
                            ],
                            "Next": "ML Workflow failed"
                        }
                    ]
                },
                "ML Workflow failed": {
                    "Cause": "SageMakerProcessingJobFailed",
                    "Type": "Fail"
                }
            }
          }
        - {
            XgbImageID:
              !FindInMap [
                AWSRegionArch2XGBoostImageRegistry,
                !Ref "AWS::Region",
                id,
              ],
            DebuggerImageId:
              !FindInMap [
                AWSRegionArch2DebuggerImageRegistry,
                !Ref "AWS::Region",
                id,
              ],
          }
      RoleArn: !GetAtt IAMRoleStepFunction.Arn
      StateMachineType: "STANDARD"
      LoggingConfiguration:
        # Destinations:
        # - CloudWatchLogsLogGroup:
        # LogGroupArn: !Sub "arn:aws:logs:${AWS::Region}:${AWS::AccountId}:log-group:/aws/vendedlogs/states/SageMakerProcessTrainWorkflow-Log:*"
        IncludeExecutionData: true
        Level: "OFF"

  StepFunctionsStateMachineInference:
    Type: "AWS::StepFunctions::StateMachine"
    Properties:
      StateMachineName: "SageMakerPreproInferWorkflow"
      DefinitionString: !Sub
        - |
          {
            "StartAt": "SageMaker Inference Step Preprocessing",
            "States": {
                "SageMaker Inference Step Preprocessing": {
                    "Resource": "arn:aws:states:::sagemaker:createProcessingJob.sync",
                    "Parameters": {
                        "ProcessingJobName.$": "$$.Execution.Input['PreprocessingJobName']",
                        "ProcessingInputs": [
                            {
                                "InputName": "code",
                                "AppManaged": false,
                                "S3Input": {
                                    "S3Uri": "s3://${PipelineBucketName}/script/inferpreprocessing.py",
                                    "LocalPath": "/opt/ml/processing/input/code",
                                    "S3DataType": "S3Prefix",
                                    "S3InputMode": "File",
                                    "S3DataDistributionType": "FullyReplicated",
                                    "S3CompressionType": "None"
                                }
                            },
                            {
                                "InputName": "processing_joblib",
                                "AppManaged": false,
                                "S3Input": {
                                    "S3Uri": "s3://${PipelineBucketName}/model/preprocessor/preprocessor.joblib",
                                    "LocalPath": "/opt/ml/processing/transformer",
                                    "S3DataType": "S3Prefix",
                                    "S3InputMode": "File",
                                    "S3DataDistributionType": "FullyReplicated",
                                    "S3CompressionType": "None"
                                }
                            }
                        ],
                        "ProcessingOutputConfig": {
                            "Outputs": [
                                {
                                    "OutputName": "infer_data",
                                    "AppManaged": false,
                                    "S3Output": {
                                        "S3Uri": "s3://${PipelineBucketName}/data/intermediate/infer_data",
                                        "LocalPath": "/opt/ml/processing/infer",
                                        "S3UploadMode": "EndOfJob"
                                    }
                                }
                            ]
                        },
                        "AppSpecification": {
                            "ImageUri": "${XgbImageID}.dkr.ecr.${AWS::Region}.amazonaws.com/sagemaker-scikit-learn:0.20.0-cpu-py3",
                            "ContainerArguments": [
                                "--database",
                                "${AthenaDatabaseName}",
                                "--region",
                                "${AWS::Region}",
                                "--table",
                                "infer",
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



