Skip to content

Commit 8923090

Browse files
author
Daniel Hegeman
authored
feat: rds error should fail loudly in sfn (#6255)
1 parent 77e0eb7 commit 8923090

File tree

1 file changed

+41
-5
lines changed
  • .happy/terraform/modules/sfn

1 file changed

+41
-5
lines changed

.happy/terraform/modules/sfn/main.tf

Lines changed: 41 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -281,8 +281,7 @@ resource "aws_sfn_state_machine" "state_machine" {
281281
"BackoffRate": 2.0
282282
} ],
283283
"Next": "DeregisterJobDefinition",
284-
"ResultPath": null,
285-
"OutputPath": "$.[0]"
284+
"ResultPath": null
286285
},
287286
"HandleErrors": {
288287
"Type": "Task",
@@ -305,11 +304,48 @@ resource "aws_sfn_state_machine" "state_machine" {
305304
},
306305
"DeregisterJobDefinition": {
307306
"Type": "Task",
308-
"End": true,
307+
"Next": "CheckForErrors",
309308
"Parameters": {
310-
"JobDefinition.$": "$.batch.JobDefinitionName"
309+
"JobDefinition.$": "$[0].batch.JobDefinitionName"
311310
},
312-
"Resource": "arn:aws:states:::aws-sdk:batch:deregisterJobDefinition"
311+
"Resource": "arn:aws:states:::aws-sdk:batch:deregisterJobDefinition",
312+
"ResultPath": null
313+
},
314+
"CheckForErrors": {
315+
"Type": "Choice",
316+
"Choices": [
317+
{
318+
"Or": [
319+
{
320+
"Variable": "$[0].error",
321+
"IsPresent": true
322+
},
323+
{
324+
"Variable": "$[1].error",
325+
"IsPresent": true
326+
}
327+
],
328+
"Next": "ConversionError"
329+
},
330+
{
331+
"Variable": "$.error",
332+
"IsPresent": true,
333+
"Next": "DownloadValidateError"
334+
}
335+
],
336+
"Default": "EndPass"
337+
},
338+
"ConversionError": {
339+
"Type": "Fail",
340+
"Cause": "CXG and/or Seurat conversion failed."
341+
},
342+
"DownloadValidateError": {
343+
"Type": "Fail",
344+
"Cause": "An error occurred during Download/Validate."
345+
},
346+
"EndPass": {
347+
"Type": "Pass",
348+
"End": true
313349
}
314350
}
315351
}

0 commit comments

Comments
 (0)