Skip to content

Commit c9c278a

Browse files
author
awstools
committed
feat(client-sfn): Add support for variables and JSONata in TestState, GetExecutionHistory, DescribeStateMachine, and DescribeStateMachineForExecution
1 parent f082da5 commit c9c278a

File tree

8 files changed

+471
-39
lines changed

8 files changed

+471
-39
lines changed

clients/client-sfn/src/commands/DescribeStateMachineCommand.ts

+5
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,11 @@ export interface DescribeStateMachineCommandOutput extends DescribeStateMachineO
108108
* // kmsDataKeyReusePeriodSeconds: Number("int"),
109109
* // type: "AWS_OWNED_KEY" || "CUSTOMER_MANAGED_KMS_KEY", // required
110110
* // },
111+
* // variableReferences: { // VariableReferences
112+
* // "<keys>": [ // VariableNameList
113+
* // "STRING_VALUE",
114+
* // ],
115+
* // },
111116
* // };
112117
*
113118
* ```

clients/client-sfn/src/commands/DescribeStateMachineForExecutionCommand.ts

+5
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,11 @@ export interface DescribeStateMachineForExecutionCommandOutput
8585
* // kmsDataKeyReusePeriodSeconds: Number("int"),
8686
* // type: "AWS_OWNED_KEY" || "CUSTOMER_MANAGED_KMS_KEY", // required
8787
* // },
88+
* // variableReferences: { // VariableReferences
89+
* // "<keys>": [ // VariableNameList
90+
* // "STRING_VALUE",
91+
* // ],
92+
* // },
8893
* // };
8994
*
9095
* ```

clients/client-sfn/src/commands/GetExecutionHistoryCommand.ts

+13-1
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ export interface GetExecutionHistoryCommandOutput extends GetExecutionHistoryOut
5757
* // events: [ // HistoryEventList // required
5858
* // { // HistoryEvent
5959
* // timestamp: new Date("TIMESTAMP"), // required
60-
* // type: "ActivityFailed" || "ActivityScheduled" || "ActivityScheduleFailed" || "ActivityStarted" || "ActivitySucceeded" || "ActivityTimedOut" || "ChoiceStateEntered" || "ChoiceStateExited" || "ExecutionAborted" || "ExecutionFailed" || "ExecutionStarted" || "ExecutionSucceeded" || "ExecutionTimedOut" || "FailStateEntered" || "LambdaFunctionFailed" || "LambdaFunctionScheduled" || "LambdaFunctionScheduleFailed" || "LambdaFunctionStarted" || "LambdaFunctionStartFailed" || "LambdaFunctionSucceeded" || "LambdaFunctionTimedOut" || "MapIterationAborted" || "MapIterationFailed" || "MapIterationStarted" || "MapIterationSucceeded" || "MapStateAborted" || "MapStateEntered" || "MapStateExited" || "MapStateFailed" || "MapStateStarted" || "MapStateSucceeded" || "ParallelStateAborted" || "ParallelStateEntered" || "ParallelStateExited" || "ParallelStateFailed" || "ParallelStateStarted" || "ParallelStateSucceeded" || "PassStateEntered" || "PassStateExited" || "SucceedStateEntered" || "SucceedStateExited" || "TaskFailed" || "TaskScheduled" || "TaskStarted" || "TaskStartFailed" || "TaskStateAborted" || "TaskStateEntered" || "TaskStateExited" || "TaskSubmitFailed" || "TaskSubmitted" || "TaskSucceeded" || "TaskTimedOut" || "WaitStateAborted" || "WaitStateEntered" || "WaitStateExited" || "MapRunAborted" || "MapRunFailed" || "MapRunStarted" || "MapRunSucceeded" || "ExecutionRedriven" || "MapRunRedriven", // required
60+
* // type: "ActivityFailed" || "ActivityScheduled" || "ActivityScheduleFailed" || "ActivityStarted" || "ActivitySucceeded" || "ActivityTimedOut" || "ChoiceStateEntered" || "ChoiceStateExited" || "ExecutionAborted" || "ExecutionFailed" || "ExecutionStarted" || "ExecutionSucceeded" || "ExecutionTimedOut" || "FailStateEntered" || "LambdaFunctionFailed" || "LambdaFunctionScheduled" || "LambdaFunctionScheduleFailed" || "LambdaFunctionStarted" || "LambdaFunctionStartFailed" || "LambdaFunctionSucceeded" || "LambdaFunctionTimedOut" || "MapIterationAborted" || "MapIterationFailed" || "MapIterationStarted" || "MapIterationSucceeded" || "MapStateAborted" || "MapStateEntered" || "MapStateExited" || "MapStateFailed" || "MapStateStarted" || "MapStateSucceeded" || "ParallelStateAborted" || "ParallelStateEntered" || "ParallelStateExited" || "ParallelStateFailed" || "ParallelStateStarted" || "ParallelStateSucceeded" || "PassStateEntered" || "PassStateExited" || "SucceedStateEntered" || "SucceedStateExited" || "TaskFailed" || "TaskScheduled" || "TaskStarted" || "TaskStartFailed" || "TaskStateAborted" || "TaskStateEntered" || "TaskStateExited" || "TaskSubmitFailed" || "TaskSubmitted" || "TaskSucceeded" || "TaskTimedOut" || "WaitStateAborted" || "WaitStateEntered" || "WaitStateExited" || "MapRunAborted" || "MapRunFailed" || "MapRunStarted" || "MapRunSucceeded" || "ExecutionRedriven" || "MapRunRedriven" || "EvaluationFailed", // required
6161
* // id: Number("long"), // required
6262
* // previousEventId: Number("long"),
6363
* // activityFailedEventDetails: { // ActivityFailedEventDetails
@@ -230,6 +230,12 @@ export interface GetExecutionHistoryCommandOutput extends GetExecutionHistoryOut
230230
* // name: "STRING_VALUE", // required
231231
* // output: "STRING_VALUE",
232232
* // outputDetails: "<HistoryEventExecutionDataDetails>",
233+
* // assignedVariables: { // AssignedVariables
234+
* // "<keys>": "STRING_VALUE",
235+
* // },
236+
* // assignedVariablesDetails: { // AssignedVariablesDetails
237+
* // truncated: true || false,
238+
* // },
233239
* // },
234240
* // mapRunStartedEventDetails: { // MapRunStartedEventDetails
235241
* // mapRunArn: "STRING_VALUE",
@@ -242,6 +248,12 @@ export interface GetExecutionHistoryCommandOutput extends GetExecutionHistoryOut
242248
* // mapRunArn: "STRING_VALUE",
243249
* // redriveCount: Number("int"),
244250
* // },
251+
* // evaluationFailedEventDetails: { // EvaluationFailedEventDetails
252+
* // error: "STRING_VALUE",
253+
* // cause: "STRING_VALUE",
254+
* // location: "STRING_VALUE",
255+
* // state: "STRING_VALUE", // required
256+
* // },
245257
* // },
246258
* // ],
247259
* // nextToken: "STRING_VALUE",

clients/client-sfn/src/commands/TestStateCommand.ts

+4-1
Original file line numberDiff line numberDiff line change
@@ -91,10 +91,11 @@ export interface TestStateCommandOutput extends TestStateOutput, __MetadataBeare
9191
* const client = new SFNClient(config);
9292
* const input = { // TestStateInput
9393
* definition: "STRING_VALUE", // required
94-
* roleArn: "STRING_VALUE", // required
94+
* roleArn: "STRING_VALUE",
9595
* input: "STRING_VALUE",
9696
* inspectionLevel: "INFO" || "DEBUG" || "TRACE",
9797
* revealSecrets: true || false,
98+
* variables: "STRING_VALUE",
9899
* };
99100
* const command = new TestStateCommand(input);
100101
* const response = await client.send(command);
@@ -104,6 +105,7 @@ export interface TestStateCommandOutput extends TestStateOutput, __MetadataBeare
104105
* // cause: "STRING_VALUE",
105106
* // inspectionData: { // InspectionData
106107
* // input: "STRING_VALUE",
108+
* // afterArguments: "STRING_VALUE",
107109
* // afterInputPath: "STRING_VALUE",
108110
* // afterParameters: "STRING_VALUE",
109111
* // result: "STRING_VALUE",
@@ -123,6 +125,7 @@ export interface TestStateCommandOutput extends TestStateOutput, __MetadataBeare
123125
* // headers: "STRING_VALUE",
124126
* // body: "STRING_VALUE",
125127
* // },
128+
* // variables: "STRING_VALUE",
126129
* // },
127130
* // nextState: "STRING_VALUE",
128131
* // status: "SUCCEEDED" || "FAILED" || "RETRIABLE" || "CAUGHT_ERROR",

clients/client-sfn/src/commands/ValidateStateMachineDefinitionCommand.ts

+23-11
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import {
99
ValidateStateMachineDefinitionInput,
1010
ValidateStateMachineDefinitionInputFilterSensitiveLog,
1111
ValidateStateMachineDefinitionOutput,
12+
ValidateStateMachineDefinitionOutputFilterSensitiveLog,
1213
} from "../models/models_0";
1314
import {
1415
de_ValidateStateMachineDefinitionCommand,
@@ -37,26 +38,37 @@ export interface ValidateStateMachineDefinitionCommandOutput
3738
__MetadataBearer {}
3839

3940
/**
40-
* <p>Validates the syntax of a state machine definition.</p>
41-
* <p>You can validate that a state machine definition is correct without
42-
* creating a state machine resource. Step Functions will implicitly perform the same
43-
* syntax check when you invoke <code>CreateStateMachine</code> and
44-
* <code>UpdateStateMachine</code>. State machine definitions are specified using a
45-
* JSON-based, structured language. For more information on Amazon States Language see <a href="https://docs.aws.amazon.com/step-functions/latest/dg/concepts-amazon-states-language.html">Amazon States Language</a> (ASL). </p>
41+
* <p>Validates the syntax of a state machine definition specified in <a href="https://docs.aws.amazon.com/step-functions/latest/dg/concepts-amazon-states-language.html">Amazon States Language</a> (ASL), a
42+
* JSON-based, structured language.</p>
43+
* <p>You can validate that a state machine definition is correct without creating a state
44+
* machine resource.</p>
4645
* <p>Suggested uses for <code>ValidateStateMachineDefinition</code>:</p>
4746
* <ul>
4847
* <li>
4948
* <p>Integrate automated checks into your code review or Continuous Integration
50-
* (CI) process to validate state machine definitions before starting
49+
* (CI) process to check state machine definitions before starting
5150
* deployments.</p>
5251
* </li>
5352
* <li>
54-
* <p>Run the validation from a Git pre-commit hook to check your state machine
55-
* definitions before committing them to your source repository.</p>
53+
* <p>Run validation from a Git pre-commit hook to verify the definition before
54+
* committing to your source repository.</p>
5655
* </li>
5756
* </ul>
57+
* <p>Validation will look for problems in your state machine definition and return a
58+
* <b>result</b> and a list of <b>diagnostic
59+
* elements</b>.</p>
60+
* <p>The <b>result</b> value will be <code>OK</code> when your
61+
* workflow definition can be successfully created or updated. Note the result can be
62+
* <code>OK</code> even when diagnostic warnings are present in the response. The
63+
* <b>result</b> value will be <code>FAIL</code> when the
64+
* workflow definition contains errors that would prevent you from creating or updating
65+
* your state machine. </p>
66+
* <p>The list of <a href="https://docs.aws.amazon.com/step-functions/latest/apireference/API_ValidateStateMachineDefinitionDiagnostic.html">ValidateStateMachineDefinitionDiagnostic</a> data elements can contain zero or more <b>WARNING</b> and/or <b>ERROR</b> elements.</p>
5867
* <note>
59-
* <p>Errors found in the state machine definition will be returned in the response as a list of <b>diagnostic elements</b>, rather than raise an exception.</p>
68+
* <p>The <b>ValidateStateMachineDefinition API</b> might add
69+
* new diagnostics in the future, adjust diagnostic codes, or change the message
70+
* wording. Your automated processes should only rely on the value of the <b>result</b> field value (OK, FAIL). Do <b>not</b> rely on the exact order, count, or
71+
* wording of diagnostic messages.</p>
6072
* </note>
6173
* @example
6274
* Use a bare-bones client and the command you need to make an API call.
@@ -118,7 +130,7 @@ export class ValidateStateMachineDefinitionCommand extends $Command
118130
})
119131
.s("AWSStepFunctions", "ValidateStateMachineDefinition", {})
120132
.n("SFNClient", "ValidateStateMachineDefinitionCommand")
121-
.f(ValidateStateMachineDefinitionInputFilterSensitiveLog, void 0)
133+
.f(ValidateStateMachineDefinitionInputFilterSensitiveLog, ValidateStateMachineDefinitionOutputFilterSensitiveLog)
122134
.ser(se_ValidateStateMachineDefinitionCommand)
123135
.de(de_ValidateStateMachineDefinitionCommand)
124136
.build() {

0 commit comments

Comments
 (0)