Skip to content

Commit f22bd4e

Browse files
authored
fix(stepfunctions-tasks): Default Retry policy for LambdaInvoke does not include Lambda.ClientExecutionTimeoutException default Retry settings (#26474)
According to the document, best practice for Step Functions which invoke a Lambda function is as follows. https://docs.aws.amazon.com/step-functions/latest/dg/bp-lambda-serviceexception.html ``` "Retry": [ { "ErrorEquals": [ "Lambda.ClientExecutionTimeoutException", "Lambda.ServiceException", "Lambda.AWSLambdaException", "Lambda.SdkClientException"], "IntervalSeconds": 2, "MaxAttempts": 6, "BackoffRate": 2 } ] ``` I have made changes to align with the official documentation. Closes #26470. ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
1 parent 1df243a commit f22bd4e

File tree

17 files changed

+32023
-1403
lines changed

17 files changed

+32023
-1403
lines changed

packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/lambda/integ.invoke.js.snapshot/IntegTestDefaultTestDeployAssertE3E7D2A4.assets.json

+5-5
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,28 @@
11
{
22
"version": "32.0.0",
33
"files": {
4-
"ae370e1010629b78f494346f49ceef3ab2875718f20e6c808114e6aa770c7bf3": {
4+
"69787af1117cf4a4b06d1936f2f27060292b3da90f9e91124d45ba7c146d4c95": {
55
"source": {
6-
"path": "asset.ae370e1010629b78f494346f49ceef3ab2875718f20e6c808114e6aa770c7bf3.bundle",
6+
"path": "asset.69787af1117cf4a4b06d1936f2f27060292b3da90f9e91124d45ba7c146d4c95.bundle",
77
"packaging": "zip"
88
},
99
"destinations": {
1010
"current_account-current_region": {
1111
"bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}",
12-
"objectKey": "ae370e1010629b78f494346f49ceef3ab2875718f20e6c808114e6aa770c7bf3.zip",
12+
"objectKey": "69787af1117cf4a4b06d1936f2f27060292b3da90f9e91124d45ba7c146d4c95.zip",
1313
"assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}"
1414
}
1515
}
1616
},
17-
"ec584201103f7b9426f3debf59afae333725223c7a8a76788868def816067ca5": {
17+
"98e273702fe35872ee56c884c375786970dc9e8299e499132ff79648f85d33c0": {
1818
"source": {
1919
"path": "IntegTestDefaultTestDeployAssertE3E7D2A4.template.json",
2020
"packaging": "file"
2121
},
2222
"destinations": {
2323
"current_account-current_region": {
2424
"bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}",
25-
"objectKey": "ec584201103f7b9426f3debf59afae333725223c7a8a76788868def816067ca5.json",
25+
"objectKey": "98e273702fe35872ee56c884c375786970dc9e8299e499132ff79648f85d33c0.json",
2626
"assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}"
2727
}
2828
}

packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/lambda/integ.invoke.js.snapshot/IntegTestDefaultTestDeployAssertE3E7D2A4.template.json

+33-12
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,23 @@
1313
"api": "startExecution",
1414
"parameters": {
1515
"stateMachineArn": {
16-
"Fn::ImportValue": "aws-stepfunctions-tasks-lambda-invoke-integ:ExportsOutputRefStateMachine2E01A3A5BA46F753"
16+
"Fn::Join": [
17+
"",
18+
[
19+
"\"",
20+
{
21+
"Fn::ImportValue": "aws-stepfunctions-tasks-lambda-invoke-integ:ExportsOutputRefStateMachine2E01A3A5BA46F753"
22+
},
23+
"\""
24+
]
25+
]
1726
}
1827
},
1928
"flattenResponse": "true",
20-
"salt": "1685114057264"
29+
"outputPaths": [
30+
"executionArn"
31+
],
32+
"salt": "1690216889138"
2133
},
2234
"UpdateReplacePolicy": "Delete",
2335
"DeletionPolicy": "Delete"
@@ -84,12 +96,12 @@
8496
"SingletonFunction1488541a7b23466481b69b4408076b81HandlerCD40AE9F": {
8597
"Type": "AWS::Lambda::Function",
8698
"Properties": {
87-
"Runtime": "nodejs14.x",
99+
"Runtime": "nodejs18.x",
88100
"Code": {
89101
"S3Bucket": {
90102
"Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}"
91103
},
92-
"S3Key": "ae370e1010629b78f494346f49ceef3ab2875718f20e6c808114e6aa770c7bf3.zip"
104+
"S3Key": "69787af1117cf4a4b06d1936f2f27060292b3da90f9e91124d45ba7c146d4c95.zip"
93105
},
94106
"Timeout": 120,
95107
"Handler": "index.handler",
@@ -118,14 +130,23 @@
118130
},
119131
"parameters": {
120132
"executionArn": {
121-
"Fn::GetAtt": [
122-
"AwsApiCallStepFunctionsstartExecutionc5cc0786542148808c24d8ebf111c7aa",
123-
"apiCallResponse.executionArn"
133+
"Fn::Join": [
134+
"",
135+
[
136+
"\"",
137+
{
138+
"Fn::GetAtt": [
139+
"AwsApiCallStepFunctionsstartExecutionc5cc0786542148808c24d8ebf111c7aa",
140+
"apiCallResponse.executionArn"
141+
]
142+
},
143+
"\""
144+
]
124145
]
125146
}
126147
},
127148
"flattenResponse": "false",
128-
"salt": "1685114057264"
149+
"salt": "1690216889139"
129150
},
130151
"UpdateReplacePolicy": "Delete",
131152
"DeletionPolicy": "Delete"
@@ -291,12 +312,12 @@
291312
"SingletonFunction76b3e830a873425f8453eddd85c86925Handler81461ECE": {
292313
"Type": "AWS::Lambda::Function",
293314
"Properties": {
294-
"Runtime": "nodejs14.x",
315+
"Runtime": "nodejs18.x",
295316
"Code": {
296317
"S3Bucket": {
297318
"Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}"
298319
},
299-
"S3Key": "ae370e1010629b78f494346f49ceef3ab2875718f20e6c808114e6aa770c7bf3.zip"
320+
"S3Key": "69787af1117cf4a4b06d1936f2f27060292b3da90f9e91124d45ba7c146d4c95.zip"
300321
},
301322
"Timeout": 120,
302323
"Handler": "index.isComplete",
@@ -333,12 +354,12 @@
333354
"SingletonFunction5c1898e096fb4e3e95d5f6c67f3ce41aHandlerADF3E6EA": {
334355
"Type": "AWS::Lambda::Function",
335356
"Properties": {
336-
"Runtime": "nodejs14.x",
357+
"Runtime": "nodejs18.x",
337358
"Code": {
338359
"S3Bucket": {
339360
"Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}"
340361
},
341-
"S3Key": "ae370e1010629b78f494346f49ceef3ab2875718f20e6c808114e6aa770c7bf3.zip"
362+
"S3Key": "69787af1117cf4a4b06d1936f2f27060292b3da90f9e91124d45ba7c146d4c95.zip"
342363
},
343364
"Timeout": 120,
344365
"Handler": "index.onTimeout",

0 commit comments

Comments
 (0)