feat(stepfunctions-tasks): add configurable timeout#38035
Open
lvthillo wants to merge 1 commit into
Open
Conversation
38f0891 to
2fa4b48
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Issue # (if applicable)
Closes #36823.
Reason for this change
The
CallAwsServiceCrossRegiontask creates an internal Lambda function to perform the cross-region AWS API call, but its timeout is hardcoded to 30 seconds. Long-running API calls (e.g. copying a large S3 object across regions, polling slow control-plane APIs) cannot complete within 30s and there is currently no way for users to override this.Description of changes
lambdaTimeout?: Durationproperty onCallAwsServiceCrossRegionOptions. When unset, thedefault remains
Duration.seconds(30), so existing behavior is preserved.CrossRegionAwsSdkSingletonFunction.fail-fast check for inputs that would always be rejected by CloudFormation at deploy time, so no feature flag is
required.
aws-stepfunctions-tasksREADME with a new section explaining the default and how to override it,including a
copyObjectexample.integ.call-aws-service-cross-regionintegration test to exercise the new prop andregenerated its snapshot via a real deploy.
Naming note
The prop is named
lambdaTimeout, nottimeout.TaskStateBaseProps(the base props the construct extends)already defines
timeoutas the Step Functions task timeout. Adding a secondtimeoutprop with differentsemantics on the merged interface would be confusing, so
lambdaTimeoutdisambiguates that this controls theinternal Lambda's execution timeout rather than the Step Functions task timeout.
Describe any new or updated permissions being added
/
Description of how you validated changes
default Lambda timeout is 30 seconds— backwards-compatibilitywith custom lambdaTimeout— verifiesDuration.minutes(15)producesTimeout: 900fails when lambdaTimeout is out of range (0 seconds)and(901 seconds)viatest.eachinteg.call-aws-service-cross-region.tsto setlambdaTimeout: Duration.seconds(60)on theCreateTabletask and regenerated the snapshot.
us-east-1viainteg-runner --update-on-failed— the state machineexecuted end-to-end successfully against real AWS.
Checklist
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license