You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It is not possible to set ResultPath, InputPath, and OutputPath to null when using the Definition property in AWS::StepFunctions::StateMachine. CloudFormation does not accept null property values.
There is a AWS::NoValue pseudo-parameter, but that just omits the property instead of serializing it to "ResultPath": null in the JSON string. This isn't the desired behaviour because ResultPath, InputPath, and OutputPath have a default value of $ when unspecified in the state machine definition.
The usage of null values is described below from the Amazon States Language specification. As a CloudFormation user, I should be able to set when using the Definition property to declare my ASL definition as a JSON/YAML object:
If the value of InputPath is null, that means that the raw input is discarded, and the effective input for the state is an empty JSON object, {}. Note that having a value of null is different from the "InputPath" field being absent.
If the value of ResultPath is null, that means that the state’s result is discarded and its raw input becomes its result.
If the value of OutputPath is null, that means the input and result are discarded, and the effective output from the state is an empty JSON object, {}.
Defaults
Each of InputPath, Parameters, ResultSelector, ResultPath, and OutputPath are optional. The default value of InputPath is "$", so by default the effective input is just the raw input. The default value of ResultPath is "$", so by default a state’s result overwrites and replaces the input. The default value of OutputPath is "$", so by default a state’s effective output is the result of processing ResultPath.
Parameters and ResultSelector have no default value. If absent, they have no effect on their input.
Therefore, if none of InputPath, Parameters, ResultSelector, ResultPath, or OutputPath are supplied, a state consumes the raw input as provided and passes its result to the next state.
Proposed Solution
Support a reserved string "NULL" or "DISCARD" for InputPath, OutputPath, and ResultPath which the resource handler translates into an explicit null property when serializing the Definition object into a JSON string before the Create/UpdateStateMachine request.
The special string we use must be a reserved keyword that would fail in the Create/UpdateStateMachine API today. Per ASL spec, the value of ResultPath, InputPath, and OutputPath must be null or valid Paths, so there is a lot of flexibility as long as it's not a JSONPath. We just need to be wary of future changes to ASL where these fields could accept a non-Path value.
Description
It is not possible to set
ResultPath
,InputPath
, andOutputPath
tonull
when using theDefinition
property inAWS::StepFunctions::StateMachine
. CloudFormation does not accept null property values.There is a
AWS::NoValue
pseudo-parameter, but that just omits the property instead of serializing it to"ResultPath": null
in the JSON string. This isn't the desired behaviour becauseResultPath
,InputPath
, andOutputPath
have a default value of$
when unspecified in the state machine definition.Current workarounds:
Use case
The usage of
null
values is described below from the Amazon States Language specification. As a CloudFormation user, I should be able to set when using theDefinition
property to declare my ASL definition as a JSON/YAML object:Proposed Solution
Support a reserved string
"NULL"
or"DISCARD"
forInputPath
,OutputPath
, andResultPath
which the resource handler translates into an explicitnull
property when serializing theDefinition
object into a JSON string before the Create/UpdateStateMachine request.Example
Using the following template:
Should yield this ASL definition in the created StateMachine:
Other Information
The special string we use must be a reserved keyword that would fail in the Create/UpdateStateMachine API today. Per ASL spec, the value of ResultPath, InputPath, and OutputPath must be
null
or valid Paths, so there is a lot of flexibility as long as it's not a JSONPath. We just need to be wary of future changes to ASL where these fields could accept a non-Path value.Related:
Acknowledgements
The text was updated successfully, but these errors were encountered: