A PyPI package providing a validator for Amazon States Language JSON/YAML files.
This package is based on Amazon Web Services Labs' awslabs/statelint.
pip install statelintstatelint fancy-state-machine-spec.jsonIf you prefer YAML, you need to install PyYaml.
pip install PyYAMLThen, run command with a --yaml parameter.
statelint --yaml fancy-state-machine-spec.yamlIf you don't like to be complained that BackoffRate doesn't end with ".0",
pass a --ignore=FLOAT parameter.
statelint --ignore=FLOAT fancy-state-machine-spec.jsonIf your Resource doesn't contain URI string,
pass a --ignore=URI parameter.
statelint --ignore=URI fancy-state-machine-spec.jsonYou can pass both parameters at the same time.
statelint --ignore=FLOAT,URI fancy-state-machine-spec.jsonIf you are using JSONata, you may be able to reduce false positives by passing the --eval-jsonata flag.
This feature is currently experimental (and might just stay that way 😉).
However, this library only references variables assigned in the "Assign" field (i.e., $states is not supported) and does not support the JSONata format within the "Assign" field itself.
To use this feature, you must install jsonata-python:
pip install jsonata-pythonstatelint --eval-jsonata fancy-state-machine-spec.json