-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'no-int-test/dac-2784-redshift-txma-new-model-step-funct…
…ion' into production-preview-release
- Loading branch information
Showing
3 changed files
with
127 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
88 changes: 88 additions & 0 deletions
88
statemachine/txma_redshift_consolidated_schema_processing.asl.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,88 @@ | ||
{ | ||
"Comment": "Redshit ELT processing workflow for loading dimension and fact tables", | ||
"StartAt": "ListExecutions", | ||
"States": { | ||
"ListExecutions": { | ||
"Type": "Task", | ||
"Next": "ValidateRunningInstances", | ||
"Parameters": { | ||
"StateMachineArn.$": "$$.StateMachine.Id", | ||
"StatusFilter": "RUNNING" | ||
}, | ||
"Resource": "arn:aws:states:::aws-sdk:sfn:listExecutions", | ||
"ResultSelector": { | ||
"runningExecutionsCount.$": "States.ArrayLength($.Executions)" | ||
} | ||
}, | ||
"ValidateRunningInstances": { | ||
"Type": "Choice", | ||
"Choices": [ | ||
{ | ||
"Variable": "$.runningExecutionsCount", | ||
"NumericGreaterThan": 1, | ||
"Next": "RunningInstanceDetected" | ||
} | ||
], | ||
"Default": "dap_datamart_update" | ||
}, | ||
"RunningInstanceDetected": { | ||
"Type": "Fail", | ||
"Error": "RunningInstanceDetected" | ||
}, | ||
"dap_datamart_update": { | ||
"Comment": "Invoke Redshift Dap DataMart update script", | ||
"Type": "Task", | ||
"Resource": "arn:aws:states:::aws-sdk:redshiftdata:executeStatement", | ||
"ResultPath": "$.sql_output", | ||
"Parameters": { | ||
"WorkgroupName": "dev-redshift-serverless-workgroup", | ||
"Database": "dap_txma_reporting_db_refactored", | ||
"Sql": "call conformed_refactored.update_dap_data_mart()" | ||
}, | ||
"Next": "wait_on_dap_datamart_update" | ||
}, | ||
"wait_on_dap_datamart_update": { | ||
"Comment": "Wait before status check", | ||
"Type": "Wait", | ||
"Seconds": 5, | ||
"Next": "dap_datamart_update_status_check" | ||
}, | ||
"dap_datamart_update_status_check": { | ||
"Comment": "Check Task Status", | ||
"Type": "Task", | ||
"Resource": "arn:aws:states:::aws-sdk:redshiftdata:describeStatement", | ||
"ResultPath": "$.sql_output", | ||
"Parameters": { | ||
"Id.$": "$.sql_output.Id" | ||
}, | ||
"Next": "is_dap_datamart_update_complete" | ||
}, | ||
"is_dap_datamart_update_complete": { | ||
"Comment": "check if DAP Datamart update step is complete", | ||
"Type": "Choice", | ||
"Choices": [ | ||
{ | ||
"Variable": "$.sql_output.Status", | ||
"StringEquals": "FAILED", | ||
"Next": "dap_datamart_update_failure" | ||
}, | ||
{ | ||
"Variable": "$.sql_output.Status", | ||
"StringEquals": "FINISHED", | ||
"Next": "StopProcessing" | ||
} | ||
], | ||
"Default": "wait_on_dap_datamart_update" | ||
}, | ||
"dap_datamart_update_failure": { | ||
"Type": "Fail", | ||
"Cause": "Failure within DAP Datamart update_step", | ||
"Error": "Error" | ||
}, | ||
"StopProcessing": { | ||
"Type": "Pass", | ||
"Result": "pass", | ||
"End": true | ||
} | ||
} | ||
} |