-
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.
No int test/dac 1919 raw layer single table (#479)
* raw layer events single table schema * raw layer events single table schema * created state machine defintion * created state machine resource * created state machine resource
- Loading branch information
1 parent
88aa440
commit 4e0f700
Showing
3 changed files
with
136 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
97 changes: 97 additions & 0 deletions
97
statemachine/txma_raw_layer_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,97 @@ | ||
{ | ||
"Comment": "AWS Step Functions state machine that processes raw datasets (consolidated schema) from TxMA into the staging layer of Athena", | ||
"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": "StartRawCrawler" | ||
}, | ||
"RunningInstanceDetected": { | ||
"Type": "Fail", | ||
"Error": "RunningInstanceDetected" | ||
}, | ||
"StartRawCrawler": { | ||
"Type": "Task", | ||
"Resource": "arn:aws:states:::aws-sdk:glue:startCrawler", | ||
"Parameters": { | ||
"Name": "${GlueCrawlerRawName}" | ||
}, | ||
"Next": "MonitorRawCrawlerStatus", | ||
"ResultPath": "$.rawCrawlerResult" | ||
}, | ||
"MonitorRawCrawlerStatus": { | ||
"Type": "Task", | ||
"Resource": "arn:aws:states:::aws-sdk:glue:getCrawler", | ||
"Parameters": { | ||
"Name": "${GlueCrawlerRawName}" | ||
}, | ||
"ResultPath": "$.crawlerRawStatus", | ||
"Next": "CheckRawCrawlerStatus" | ||
}, | ||
"CheckRawCrawlerStatus": { | ||
"Type": "Choice", | ||
"Choices": [ | ||
{ | ||
"Variable": "$.crawlerRawStatus.Crawler.State", | ||
"StringEquals": "READY", | ||
"Next": "RawCrawlerFinished" | ||
}, | ||
{ | ||
"Or": [ | ||
{ | ||
"Variable": "$.crawlerRawStatus.Crawler.State", | ||
"StringEquals": "RUNNING" | ||
}, | ||
{ | ||
"Variable": "$.crawlerRawStatus.Crawler.State", | ||
"StringEquals": "STOPPING" | ||
}, | ||
{ | ||
"Variable": "$.crawlerRawStatus.Crawler.State", | ||
"StringEquals": "STARTED" | ||
} | ||
], | ||
"Next": "WaitForRawCrawler" | ||
} | ||
], | ||
"Default": "CrawlerFailed" | ||
}, | ||
"WaitForRawCrawler": { | ||
"Type": "Wait", | ||
"Seconds": 30, | ||
"Next": "MonitorRawCrawlerStatus" | ||
}, | ||
"RawCrawlerFinished": { | ||
"Type": "Pass", | ||
"Next": "StopProcessing" | ||
}, | ||
"StopProcessing": { | ||
"Type": "Pass", | ||
"End": true | ||
}, | ||
"CrawlerFailed": { | ||
"Type": "Fail", | ||
"Error": "CrawlerFailed", | ||
"Cause": "The Glue crawler execution failed." | ||
} | ||
} | ||
} |