Skip to content

Instantly share code, notes, and snippets.

@edmondop
Created January 29, 2024 14:57
Show Gist options
  • Save edmondop/add4b9949664c13da8f564bf5bc6d54b to your computer and use it in GitHub Desktop.
Save edmondop/add4b9949664c13da8f564bf5bc6d54b to your computer and use it in GitHub Desktop.
AWS Step
{
"ChoiceStateX": {
"Type": "Choice",
"Choices": [
{
"Not": {
"Variable": "$.type",
"StringEquals": "Private"
},
"Next": "Public"
},
{
"Variable": "$.value",
"NumericEquals": 0,
"Next": "ValueIsZero"
},
{
"And": [
{
"Variable": "$.value",
"NumericGreaterThanEquals": 20
},
{
"Variable": "$.value",
"NumericLessThan": 30
}
],
"Next": "ValueInTwenties"
}
],
"Default": "DefaultState"
},
"Public": {
"Type": "Task",
"Resource": "arn:aws:lambda:us-east-1:123456789012:function:Foo",
"Next": "NextState"
},
"ValueIsZero": {
"Type": "Task",
"Resource": "arn:aws:lambda:us-east-1:123456789012:function:Zero",
"Next": "NextState"
},
"ValueInTwenties": {
"Type": "Task",
"Resource": "arn:aws:lambda:us-east-1:123456789012:function:Bar",
"Next": "NextState"
},
"DefaultState": {
"Type": "Fail",
"Cause": "No Matches!"
}
}
if (type.equals("Private")) {
lambda.foo(value);
} else if (value >= 20 && value <= 30) {
lambda.bar(value);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment