fix(custom-resources): waiter state machine retry fails with ExecutionAlreadyExists #35988
+20
−2
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.
Description
Fixes an issue where retrying a CloudFormation deployment that uses a custom resource with an async waiter fails with
ExecutionAlreadyExistserror.Root Cause
The custom resource provider framework uses CloudFormation's
RequestIdas the Step Functions execution name when starting the waiter state machine. When CloudFormation retries a failed deployment, it reuses the sameRequestId. Since Step Functions execution names must be unique for 90 days, subsequent retry attempts fail withExecutionAlreadyExists.Solution
Removed the
nameparameter from thestartExecutioncall, allowing Step Functions to auto-generate unique execution names. This is the recommended approach per the AWS Step Functions StartExecution API Reference, where thenameparameter is optional and Step Functions will automatically generate a universally unique identifier (UUID) as the execution name if not provided.Changes
name: resourceEvent.RequestIdfrom the waiter state machine execution call inframework.tsnamefieldnameis not included in thestartExecutioncallTesting
waiter state machine execution does not include name field (allows retries)to verify the fixnamebeing undefinedRelated Issue
Fixes #35957
Verification
The fix was verified by:
namefield is not includedBy submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license