Skip to content

Commit

Permalink
fix(stepfunctions-tasks): Default Retry policy for LambdaInvoke doe…
Browse files Browse the repository at this point in the history
…s 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*
  • Loading branch information
tmyoda authored Jul 24, 2023
1 parent 1df243a commit f22bd4e
Show file tree
Hide file tree
Showing 17 changed files with 32,023 additions and 1,403 deletions.
Original file line number Diff line number Diff line change
@@ -1,28 +1,28 @@
{
"version": "32.0.0",
"files": {
"ae370e1010629b78f494346f49ceef3ab2875718f20e6c808114e6aa770c7bf3": {
"69787af1117cf4a4b06d1936f2f27060292b3da90f9e91124d45ba7c146d4c95": {
"source": {
"path": "asset.ae370e1010629b78f494346f49ceef3ab2875718f20e6c808114e6aa770c7bf3.bundle",
"path": "asset.69787af1117cf4a4b06d1936f2f27060292b3da90f9e91124d45ba7c146d4c95.bundle",
"packaging": "zip"
},
"destinations": {
"current_account-current_region": {
"bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}",
"objectKey": "ae370e1010629b78f494346f49ceef3ab2875718f20e6c808114e6aa770c7bf3.zip",
"objectKey": "69787af1117cf4a4b06d1936f2f27060292b3da90f9e91124d45ba7c146d4c95.zip",
"assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}"
}
}
},
"ec584201103f7b9426f3debf59afae333725223c7a8a76788868def816067ca5": {
"98e273702fe35872ee56c884c375786970dc9e8299e499132ff79648f85d33c0": {
"source": {
"path": "IntegTestDefaultTestDeployAssertE3E7D2A4.template.json",
"packaging": "file"
},
"destinations": {
"current_account-current_region": {
"bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}",
"objectKey": "ec584201103f7b9426f3debf59afae333725223c7a8a76788868def816067ca5.json",
"objectKey": "98e273702fe35872ee56c884c375786970dc9e8299e499132ff79648f85d33c0.json",
"assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}"
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,23 @@
"api": "startExecution",
"parameters": {
"stateMachineArn": {
"Fn::ImportValue": "aws-stepfunctions-tasks-lambda-invoke-integ:ExportsOutputRefStateMachine2E01A3A5BA46F753"
"Fn::Join": [
"",
[
"\"",
{
"Fn::ImportValue": "aws-stepfunctions-tasks-lambda-invoke-integ:ExportsOutputRefStateMachine2E01A3A5BA46F753"
},
"\""
]
]
}
},
"flattenResponse": "true",
"salt": "1685114057264"
"outputPaths": [
"executionArn"
],
"salt": "1690216889138"
},
"UpdateReplacePolicy": "Delete",
"DeletionPolicy": "Delete"
Expand Down Expand Up @@ -84,12 +96,12 @@
"SingletonFunction1488541a7b23466481b69b4408076b81HandlerCD40AE9F": {
"Type": "AWS::Lambda::Function",
"Properties": {
"Runtime": "nodejs14.x",
"Runtime": "nodejs18.x",
"Code": {
"S3Bucket": {
"Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}"
},
"S3Key": "ae370e1010629b78f494346f49ceef3ab2875718f20e6c808114e6aa770c7bf3.zip"
"S3Key": "69787af1117cf4a4b06d1936f2f27060292b3da90f9e91124d45ba7c146d4c95.zip"
},
"Timeout": 120,
"Handler": "index.handler",
Expand Down Expand Up @@ -118,14 +130,23 @@
},
"parameters": {
"executionArn": {
"Fn::GetAtt": [
"AwsApiCallStepFunctionsstartExecutionc5cc0786542148808c24d8ebf111c7aa",
"apiCallResponse.executionArn"
"Fn::Join": [
"",
[
"\"",
{
"Fn::GetAtt": [
"AwsApiCallStepFunctionsstartExecutionc5cc0786542148808c24d8ebf111c7aa",
"apiCallResponse.executionArn"
]
},
"\""
]
]
}
},
"flattenResponse": "false",
"salt": "1685114057264"
"salt": "1690216889139"
},
"UpdateReplacePolicy": "Delete",
"DeletionPolicy": "Delete"
Expand Down Expand Up @@ -291,12 +312,12 @@
"SingletonFunction76b3e830a873425f8453eddd85c86925Handler81461ECE": {
"Type": "AWS::Lambda::Function",
"Properties": {
"Runtime": "nodejs14.x",
"Runtime": "nodejs18.x",
"Code": {
"S3Bucket": {
"Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}"
},
"S3Key": "ae370e1010629b78f494346f49ceef3ab2875718f20e6c808114e6aa770c7bf3.zip"
"S3Key": "69787af1117cf4a4b06d1936f2f27060292b3da90f9e91124d45ba7c146d4c95.zip"
},
"Timeout": 120,
"Handler": "index.isComplete",
Expand Down Expand Up @@ -333,12 +354,12 @@
"SingletonFunction5c1898e096fb4e3e95d5f6c67f3ce41aHandlerADF3E6EA": {
"Type": "AWS::Lambda::Function",
"Properties": {
"Runtime": "nodejs14.x",
"Runtime": "nodejs18.x",
"Code": {
"S3Bucket": {
"Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}"
},
"S3Key": "ae370e1010629b78f494346f49ceef3ab2875718f20e6c808114e6aa770c7bf3.zip"
"S3Key": "69787af1117cf4a4b06d1936f2f27060292b3da90f9e91124d45ba7c146d4c95.zip"
},
"Timeout": 120,
"Handler": "index.onTimeout",
Expand Down
Loading

0 comments on commit f22bd4e

Please sign in to comment.