15
15
use AsyncAws \StepFunctions \Exception \InvalidNameException ;
16
16
use AsyncAws \StepFunctions \Exception \InvalidOutputException ;
17
17
use AsyncAws \StepFunctions \Exception \InvalidTokenException ;
18
+ use AsyncAws \StepFunctions \Exception \KmsAccessDeniedException ;
19
+ use AsyncAws \StepFunctions \Exception \KmsInvalidStateException ;
20
+ use AsyncAws \StepFunctions \Exception \KmsThrottlingException ;
18
21
use AsyncAws \StepFunctions \Exception \StateMachineDeletingException ;
19
22
use AsyncAws \StepFunctions \Exception \StateMachineDoesNotExistException ;
20
23
use AsyncAws \StepFunctions \Exception \TaskDoesNotExistException ;
@@ -37,6 +40,12 @@ class StepFunctionsClient extends AbstractApi
37
40
* Used by activity workers, Task states using the callback [^1] pattern, and optionally Task states using the job run
38
41
* [^2] pattern to report that the task identified by the `taskToken` failed.
39
42
*
43
+ * For an execution with encryption enabled, Step Functions will encrypt the error and cause fields using the KMS key
44
+ * for the execution role.
45
+ *
46
+ * A caller can mark a task as fail without using any KMS permissions in the execution role if the caller provides a
47
+ * null value for both `error` and `cause` fields because no data needs to be encrypted.
48
+ *
40
49
* [^1]: https://docs.aws.amazon.com/step-functions/latest/dg/connect-to-resource.html#connect-wait-token
41
50
* [^2]: https://docs.aws.amazon.com/step-functions/latest/dg/connect-to-resource.html#connect-sync
42
51
*
@@ -53,6 +62,9 @@ class StepFunctionsClient extends AbstractApi
53
62
* @throws TaskDoesNotExistException
54
63
* @throws InvalidTokenException
55
64
* @throws TaskTimedOutException
65
+ * @throws KmsAccessDeniedException
66
+ * @throws KmsInvalidStateException
67
+ * @throws KmsThrottlingException
56
68
*/
57
69
public function sendTaskFailure ($ input ): SendTaskFailureOutput
58
70
{
@@ -61,6 +73,9 @@ public function sendTaskFailure($input): SendTaskFailureOutput
61
73
'TaskDoesNotExist ' => TaskDoesNotExistException::class,
62
74
'InvalidToken ' => InvalidTokenException::class,
63
75
'TaskTimedOut ' => TaskTimedOutException::class,
76
+ 'KmsAccessDeniedException ' => KmsAccessDeniedException::class,
77
+ 'KmsInvalidStateException ' => KmsInvalidStateException::class,
78
+ 'KmsThrottlingException ' => KmsThrottlingException::class,
64
79
]]));
65
80
66
81
return new SendTaskFailureOutput ($ response );
@@ -127,6 +142,9 @@ public function sendTaskHeartbeat($input): SendTaskHeartbeatOutput
127
142
* @throws InvalidOutputException
128
143
* @throws InvalidTokenException
129
144
* @throws TaskTimedOutException
145
+ * @throws KmsAccessDeniedException
146
+ * @throws KmsInvalidStateException
147
+ * @throws KmsThrottlingException
130
148
*/
131
149
public function sendTaskSuccess ($ input ): SendTaskSuccessOutput
132
150
{
@@ -136,6 +154,9 @@ public function sendTaskSuccess($input): SendTaskSuccessOutput
136
154
'InvalidOutput ' => InvalidOutputException::class,
137
155
'InvalidToken ' => InvalidTokenException::class,
138
156
'TaskTimedOut ' => TaskTimedOutException::class,
157
+ 'KmsAccessDeniedException ' => KmsAccessDeniedException::class,
158
+ 'KmsInvalidStateException ' => KmsInvalidStateException::class,
159
+ 'KmsThrottlingException ' => KmsThrottlingException::class,
139
160
]]));
140
161
141
162
return new SendTaskSuccessOutput ($ response );
@@ -203,6 +224,9 @@ public function sendTaskSuccess($input): SendTaskSuccessOutput
203
224
* @throws StateMachineDoesNotExistException
204
225
* @throws StateMachineDeletingException
205
226
* @throws ValidationException
227
+ * @throws KmsAccessDeniedException
228
+ * @throws KmsInvalidStateException
229
+ * @throws KmsThrottlingException
206
230
*/
207
231
public function startExecution ($ input ): StartExecutionOutput
208
232
{
@@ -216,6 +240,9 @@ public function startExecution($input): StartExecutionOutput
216
240
'StateMachineDoesNotExist ' => StateMachineDoesNotExistException::class,
217
241
'StateMachineDeleting ' => StateMachineDeletingException::class,
218
242
'ValidationException ' => ValidationException::class,
243
+ 'KmsAccessDeniedException ' => KmsAccessDeniedException::class,
244
+ 'KmsInvalidStateException ' => KmsInvalidStateException::class,
245
+ 'KmsThrottlingException ' => KmsThrottlingException::class,
219
246
]]));
220
247
221
248
return new StartExecutionOutput ($ response );
@@ -226,6 +253,12 @@ public function startExecution($input): StartExecutionOutput
226
253
*
227
254
* This API action is not supported by `EXPRESS` state machines.
228
255
*
256
+ * For an execution with encryption enabled, Step Functions will encrypt the error and cause fields using the KMS key
257
+ * for the execution role.
258
+ *
259
+ * A caller can stop an execution without using any KMS permissions in the execution role if the caller provides a null
260
+ * value for both `error` and `cause` fields because no data needs to be encrypted.
261
+ *
229
262
* @see https://docs.aws.amazon.com/step-functions/latest/apireference/API_StopExecution.html
230
263
* @see https://docs.aws.amazon.com/aws-sdk-php/v3/api/api-states-2016-11-23.html#stopexecution
231
264
*
@@ -239,6 +272,9 @@ public function startExecution($input): StartExecutionOutput
239
272
* @throws ExecutionDoesNotExistException
240
273
* @throws InvalidArnException
241
274
* @throws ValidationException
275
+ * @throws KmsAccessDeniedException
276
+ * @throws KmsInvalidStateException
277
+ * @throws KmsThrottlingException
242
278
*/
243
279
public function stopExecution ($ input ): StopExecutionOutput
244
280
{
@@ -247,6 +283,9 @@ public function stopExecution($input): StopExecutionOutput
247
283
'ExecutionDoesNotExist ' => ExecutionDoesNotExistException::class,
248
284
'InvalidArn ' => InvalidArnException::class,
249
285
'ValidationException ' => ValidationException::class,
286
+ 'KmsAccessDeniedException ' => KmsAccessDeniedException::class,
287
+ 'KmsInvalidStateException ' => KmsInvalidStateException::class,
288
+ 'KmsThrottlingException ' => KmsThrottlingException::class,
250
289
]]));
251
290
252
291
return new StopExecutionOutput ($ response );
0 commit comments