aws / aws-cdk

The AWS Cloud Development Kit is a framework for defining cloud infrastructure in code
https://aws.amazon.com/cdk
Apache License 2.0
11.59k stars 3.89k forks source link

aws-stepfunctions-tasks: support revision id in StepFunctionsStartExecution #26532

Open AlJohri opened 1 year ago

AlJohri commented 1 year ago

Describe the feature

Step Functions now supports Versions and Aliases.

I would like to have the tasks.StepFunctionsStartExecution link to a specific state machine revision ID.

Use Case

The use case is where there is a parent and child nested step function. If a deploy occurs that updates the nested step function, this may break long running executions of the parent. By linking the parent step function to a revision of the child step function, we can prevent many such breakages.

Proposed Solution

Currently tasks.StepFunctionsStartExecution accepts a StateMachine. I would instead like to pass the stateMachineRevisionId which was added here: https://github.com/aws/aws-cdk/pull/26443

Other Information

No response

Acknowledgements

CDK version used

Latest

Environment details (OS name and version, etc.)

Amazon Linux 2

wong-a commented 1 year ago

StartExecution only accepts qualified state machine ARNs for the startMachineArn API parameter, not a revisionId. The scope of this issue should be to support invoking a state machine version or alias in StepFunctionsStartExecution.

Another proposed solution is to add stateMachineArn parameter to the construct, which just takes a string, which the user can pass the reference to an ARN from a CfnStateMachineVersion or CfnStateMachineAlias or even a static string.

peterwoodworth commented 1 year ago

Thanks for the additional context and clarification @wong-a