Guest User

sample_step_function_json

a guest
May 23rd, 2024
124
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.07 KB | None | 0 0
  1. {
  2. "Comment": "Orchestrate Redshift Procedures",
  3. "StartAt": "GetObject",
  4. "States": {
  5. "GetObject": {
  6. "Type": "Task",
  7. "Next": "Batches",
  8. "Parameters": {
  9. "Bucket": "test-bucket",
  10. "Key": "config/orchestration.json"
  11. },
  12. "Resource": "arn:aws:states:::aws-sdk:s3:getObject",
  13. "ResultSelector": {
  14. "s3Body.$": "States.StringToJson($.Body)"
  15. },
  16. "OutputPath": "$.s3Body"
  17. },
  18. "Batches": {
  19. "Type": "Map",
  20. "ItemProcessor": {
  21. "ProcessorConfig": {
  22. "Mode": "INLINE"
  23. },
  24. "StartAt": "Procedures",
  25. "States": {
  26. "Procedures": {
  27. "Type": "Map",
  28. "ItemProcessor": {
  29. "ProcessorConfig": {
  30. "Mode": "INLINE"
  31. },
  32. "StartAt": "ExecuteStatement",
  33. "States": {
  34. "ExecuteStatement": {
  35. "Type": "Task",
  36. "Parameters": {
  37. "ClusterIdentifier": "test-redshift",
  38. "Database": "test_db",
  39. "Sql.$": "$.sql",
  40. "DbUser": "test-admin"
  41. },
  42. "Resource": "arn:aws:states:::aws-sdk:redshiftdata:executeStatement",
  43. "ResultPath": "$.sql_output",
  44. "Next": "DescribeStatement"
  45. },
  46. "DescribeStatement": {
  47. "Type": "Task",
  48. "Parameters": {
  49. "Id.$": "$.sql_output.Id"
  50. },
  51. "Resource": "arn:aws:states:::aws-sdk:redshiftdata:describeStatement",
  52. "Next": "Choice",
  53. "ResultPath": "$.sql_output"
  54. },
  55. "Choice": {
  56. "Type": "Choice",
  57. "Choices": [
  58. {
  59. "Variable": "$.sql_output.Status",
  60. "StringEquals": "FINISHED",
  61. "Next": "Success"
  62. },
  63. {
  64. "Variable": "$.sql_output.Status",
  65. "StringEquals": "FAILED",
  66. "Next": "Fail"
  67. },
  68. {
  69. "Variable": "$.sql_output.Status",
  70. "StringEquals": "ABORTED",
  71. "Next": "Fail"
  72. }
  73. ],
  74. "Default": "Wait"
  75. },
  76. "Fail": {
  77. "Type": "Fail"
  78. },
  79. "Success": {
  80. "Type": "Succeed"
  81. },
  82. "Wait": {
  83. "Type": "Wait",
  84. "Seconds": 5,
  85. "Next": "DescribeStatement"
  86. }
  87. }
  88. },
  89. "End": true,
  90. "ItemsPath": "$.procedures",
  91. "MaxConcurrency": 3
  92. }
  93. }
  94. },
  95. "MaxConcurrency": 1,
  96. "End": true,
  97. "ItemsPath": "$.batches"
  98. }
  99. }
  100. }
Advertisement
Add Comment
Please, Sign In to add comment