Skip to content
v2.275.0

StateMachineInput Class ​

Represents the input for the StateMachine.

Example ​

ts
import * as stepfunctions from 'aws-cdk-lib/aws-stepfunctions';
const pipeline = new codepipeline.Pipeline(this, 'MyPipeline');
const startState = new stepfunctions.Pass(this, 'StartState');
const simpleStateMachine  = new stepfunctions.StateMachine(this, 'SimpleStateMachine', {
  definition: startState,
});
const stepFunctionAction = new codepipeline_actions.StepFunctionInvokeAction({
  actionName: 'Invoke',
  stateMachine: simpleStateMachine,
  stateMachineInput: codepipeline_actions.StateMachineInput.literal({ IsHelloWorldExample: true }),
});
pipeline.addStage({
  stageName: 'StepFunctions',
  actions: [stepFunctionAction],
});

Properties ​

inputanyinputAnyinputObjectInputobjectInputinterface{}= none#
When InputType is set to Literal (default), the Input field is used directly as the input for the state machine execution.

Otherwise, the state machine is invoked with an empty JSON object {}.

When InputType is set to FilePath, this field is required. An input artifact is also required when InputType is set to FilePath.

inputArtifactmay be undefinedArtifactinput_artifactmay be undefinedArtifactinputArtifactmay be undefinedArtifactInputArtifactmay be undefinedArtifactInputArtifactmay be undefinedArtifact#
The optional input Artifact of the Action.

Default: the Action will not have any inputs

If InputType is set to FilePath, this artifact is required and is used to source the input for the state machine execution.

inputTypemay be undefinedstringinput_typemay be undefinedstrinputTypemay be undefinedStringInputTypemay be undefinedstringInputTypemay be undefined*string= Literal#
Optional StateMachine InputType InputType can be Literal or FilePath.

Methods ​

filePath(inputFile: ArtifactPath): StateMachineInput // chainable@staticmethod def file_path(input_file: ArtifactPath) -> StateMachineInputpublic static StateMachineInput filePath(ArtifactPath inputFile)public static StateMachineInput FilePath(ArtifactPath inputFile)func FilePath(InputFile ArtifactPath) StateMachineInputstatic#
When the input type is FilePath, input artifact and filepath must be specified.
literal(object: json): StateMachineInput // chainable@staticmethod def literal(object: Any) -> StateMachineInputpublic static StateMachineInput literal(Object object)public static StateMachineInput Literal(object object)func Literal(Object interface{}) StateMachineInputstatic#
When the input type is Literal, input value is passed directly to the state machine input.