Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

aws-stepfunctions-tasks: Allow setting task name #26887

Open
1 of 2 tasks
iRoachie opened this issue Aug 25, 2023 · 1 comment
Open
1 of 2 tasks

aws-stepfunctions-tasks: Allow setting task name #26887

iRoachie opened this issue Aug 25, 2023 · 1 comment
Labels
@aws-cdk/aws-stepfunctions-tasks effort/medium Medium work item – several days of effort feature-request A feature should be added or improved. p2

Comments

@iRoachie
Copy link
Contributor

iRoachie commented Aug 25, 2023

Describe the feature

When defining step function tasks, the api accepts scope and id as inputs, and the id is used as the name of the task.

e.g:

 const reportFailedTask = new Tasks.LambdaInvoke(
    scope,
    'Publish Fail Status',
    {
      lambdaFunction: reportFailedFunction,
    }
  )

results to a definition like:

 "Publish Fail Status": {
      "Type": "Task",
      "Resource": "arn:aws:states:::lambda:invoke",
      "Parameters": {
        "FunctionName": "arn:aws:xxx",
        "Payload.$": "$"
      }
    }

You can imagine a stack having multiple state machines with a task named Publish Fail Status but since cdk uses the id arg for the construct, it can't be reused.

We should clearly be able to set construct id, separate from the name of the task.

e.g

 const reportFailedTask = new Tasks.LambdaInvoke(
    scope,
    'entity-report-failed-task',
    {
      taskName: 'Publish Fail Status',
      lambdaFunction: reportFailedFunction,
    }
  )

Use Case

I need this feature, cause it's annoying to have to come up with a unique task name per state machine, and it hurts the readability of the definition in the UI.

Proposed Solution

Allow a taskName prop in the task properties.

If supplied use it as the task name, If not, cdk should use the id to ensure this feature is backwards compatible

Acknowledgements

  • I may be able to implement this feature request
  • This feature might incur a breaking change

CDK version used

2.93.0

Environment details (OS name and version, etc.)

Mac OS 13.5.1

@iRoachie iRoachie added feature-request A feature should be added or improved. needs-triage This issue or PR still needs to be triaged. labels Aug 25, 2023
@peterwoodworth peterwoodworth added p1 effort/medium Medium work item – several days of effort and removed needs-triage This issue or PR still needs to be triaged. labels Aug 25, 2023
@peterwoodworth
Copy link
Contributor

Sounds to me like it might need a feature flag, but I see the pain point. Thanks for the request!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
@aws-cdk/aws-stepfunctions-tasks effort/medium Medium work item – several days of effort feature-request A feature should be added or improved. p2
Projects
None yet
Development

No branches or pull requests

3 participants