diff --git a/src/cfnlint/data/schemas/other/step_functions/statemachine.json b/src/cfnlint/data/schemas/other/step_functions/statemachine.json index 9a90894720..a9eaacd95a 100644 --- a/src/cfnlint/data/schemas/other/step_functions/statemachine.json +++ b/src/cfnlint/data/schemas/other/step_functions/statemachine.json @@ -365,6 +365,9 @@ "null" ] }, + "ResultSelector": { + "type": "object" + }, "Retry": { "items": { "properties": { @@ -653,6 +656,9 @@ "Comment": { "type": "string" }, + "Credentials": { + "type": ["string", "object"] + }, "End": { "enum": [ true diff --git a/test/unit/rules/resources/stepfunctions/test_state_machine_definition.py b/test/unit/rules/resources/stepfunctions/test_state_machine_definition.py index c90525cd32..69eecf2e03 100644 --- a/test/unit/rules/resources/stepfunctions/test_state_machine_definition.py +++ b/test/unit/rules/resources/stepfunctions/test_state_machine_definition.py @@ -308,6 +308,85 @@ def rule(): }, [], ), + ( + "Test functions", + { + "StartAt": "Task1", + "States": { + "Task1": { + "Type": "Task", + "Credentials": { + "Data": "input data", + "Algorithm": "SHA-1", + }, + "Resource": "arn:aws:states:::batch:submitJob.sync", + "End": True, + }, + }, + }, + [], + ), + ( + "Choices", + { + "StartAt": "ChoiceStateX", + "States": { + "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", + }, + { + "Variable": "$.value", + "NumericLessThan": 0, + "Next": "ValueIsNegative", + }, + ], + "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", + }, + "ValueIsNegative": { + "Type": "Succeed", + }, + "DefaultState": {"Type": "Fail", "Cause": "No Matches!"}, + }, + }, + [], + ), ( "Invalid configuration", {