states-language-from-cloudformation
Extracts states-language from cloudformation (AWS::StepFunctions::StateMachine)
Last updated 4 months ago by robodo .
ISC · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install states-language-from-cloudformation 
SYNC missed versions from official npm registry.

states-language-from-cloudformation

Extracts states-language from cloudformation (AWS::StepFunctions::StateMachine)

Tested with cloudformation generated by aws-cdk@1.21.0.

Examples

Single statemachine in template:


$ cat test/fixtures/template2.json | npx states-language-from-cloudformation

{"StartAt":"Submit Job","States":{"Submit Job":{"Next":"Wait X Seconds","Type":"Task","Resource":"Ref!","ResultPath":"$.guid"},"Wait X Seconds":{"Type":"Wait","Seconds":5,"Next":"Get Job Status"},"Get Job Status":{"Next":"Job A Complete?","InputPath":"$.guid","Type":"Task","Resource":"Ref!","ResultPath":"$.status"},"Job A Complete?":{"Type":"Choice","Choices":[{"Variable":"$.status","StringEquals":"FAILED","Next":"Job Failed"},{"Variable":"$.status","StringEquals":"SUCCEEDED","Next":"Get Final Job Status"}],"Default":"Wait X Seconds"},"Job Failed":{"Type":"Fail","Error":"DescribeJob returned FAILED","Cause":"AWS Batch Job Failed"},"Get Final Job Status":{"End":true,"InputPath":"$.guid","Type":"Task","Resource":"Ref!"}},"TimeoutSeconds":300}

Multiple statemachines in template:


 $ cat test/fixtures/template1.json | npx states-language-from-cloudformation
 
{"StartAt":"Submit Job","States":{"Submit Job":{"Next":"Wait X Seconds","Type":"Task","Resource":"Ref!","ResultPath":"$.guid"},"Wait X Seconds":{"Type":"Wait","Seconds":5,"Next":"Get Job Status"},"Get Job Status":{"Next":"Job A Complete?","InputPath":"$.guid","Type":"Task","Resource":"Ref!","ResultPath":"$.status"},"Job A Complete?":{"Type":"Choice","Choices":[{"Variable":"$.status","StringEquals":"FAILED","Next":"Job Failed"},{"Variable":"$.status","StringEquals":"SUCCEEDED","Next":"Get Final Job Status"}],"Default":"Wait X Seconds"},"Job Failed":{"Type":"Fail","Error":"DescribeJob returned FAILED","Cause":"AWS Batch Job Failed"},"Get Final Job Status":{"End":true,"InputPath":"$.guid","Type":"Task","Resource":"Ref!"}},"TimeoutSeconds":300}
{"StartAt":"Get Final Job b Status","States":{"Get Final Job b Status":{"End":true,"InputPath":"$.guid","Type":"Task","Resource":"Ref!"}},"TimeoutSeconds":300}

Current Tags

  • 0.0.2                                ...           latest (4 months ago)

2 Versions

  • 0.0.2                                ...           4 months ago
  • 0.0.1                                ...           4 months ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 2
Dependencies (1)
Dev Dependencies (1)
Dependents (0)
None

Copyright 2014 - 2016 © taobao.org |