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

awsstepfunctions|awsstepfunctionstasks: Allow custom state names #23532

Closed
2 tasks
jerrydevin96 opened this issue Jan 2, 2023 · 7 comments · Fixed by #27306
Closed
2 tasks

awsstepfunctions|awsstepfunctionstasks: Allow custom state names #23532

jerrydevin96 opened this issue Jan 2, 2023 · 7 comments · Fixed by #27306
Assignees
Labels
@aws-cdk/aws-stepfunctions Related to AWS StepFunctions effort/small Small work item – less than a day of effort feature-request A feature should be added or improved. good first issue Related to contributions. See CONTRIBUTING.md p1

Comments

@jerrydevin96
Copy link

Describe the feature

We use the go bindings for AWS CDK (https://github.com/aws/aws-cdk-go) to deploy state machines. The functions provided to create a state machine in the library do not have the option to add a custom state name, which is possible while creating a state machine from the console. instead while using the CDK, the state name is auto-generated from other inputs provided while defining the state machine. This auto-generated state name is too long and confusing.

Use Case

Too long state names are confusing. Having the possibility to add a custom user-defined state name would be really good.

Proposed Solution

Add additional struct field to define custom state names.

Other Information

I am raising this issue here, as the Go Bindings (https://github.com/aws/aws-cdk-go) do not have issues enabled.

Acknowledgements

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

CDK version used

2.49.1

Environment details (OS name and version, etc.)

macOS v12.5.1

@jerrydevin96 jerrydevin96 added feature-request A feature should be added or improved. needs-triage This issue or PR still needs to be triaged. labels Jan 2, 2023
@github-actions github-actions bot added the @aws-cdk/custom-resources Related to AWS CDK Custom Resources label Jan 2, 2023
@rix0rrr
Copy link
Contributor

rix0rrr commented Jan 4, 2023

It should be simple enough to add a stateName property to every state. Some care should be taken for using the same StateMachineFragment multiple times though.

@rix0rrr rix0rrr added effort/small Small work item – less than a day of effort p1 and removed needs-triage This issue or PR still needs to be triaged. labels Jan 4, 2023
@rix0rrr rix0rrr removed their assignment Jan 4, 2023
@rix0rrr rix0rrr added the good first issue Related to contributions. See CONTRIBUTING.md label Jan 4, 2023
@jerrydevin96
Copy link
Author

jerrydevin96 commented Jan 6, 2023

Will this have to be implemented in the current repository (https://github.com/aws/aws-cdk) or should it be implemented in the go bindings (https://github.com/aws/aws-cdk-go) repository?

@Jacco
Copy link
Contributor

Jacco commented Jan 7, 2023

I do not understand the issue raised here. Looking at the code it seems to me that everywhere the logical id of the State construct is used as the name of the State in the rendered JSON.

@jerrydevin96
Copy link
Author

@Jacco yeah, you are right in saying that. The logical id which uniquely identifies what is being deployed through CDK is also used as the name of the state.

The problem is that we are using CDK in an application that will be using 40+ lambdas. Considering the application size and our architecture we follow a hierarchical naming structure for each logical id (eg. in case we are invoking a lambda as part of a state machine, the reference logical id could be something like appname-lambdaname-lambda-invoke). When the same logical ID is used as a state name, sometimes the length exceeds 80 characters and AWS doesn't allow state names over 80 chars long. Also having very long state names is confusing when viewing the state machine on the console.

We are following a hierarchical naming pattern for the logical id because it needs to be unique for every resource created by CDK.

Sorry for the late reply!

@bun913
Copy link
Contributor

bun913 commented Feb 15, 2023

Hello!
May I challenge this issue?

@bun913
Copy link
Contributor

bun913 commented Feb 17, 2023

I was going to start working on this Issue, but as per the following comment, I reconsidered whether it is a problem on the naming convention side.

#23532 (comment)

I was going to start working on this issue, but then I reconsidered and wondered if it would be possible to write the logic on the naming side so that it would not be too long.

@SankyRed SankyRed self-assigned this Sep 6, 2023
@SankyRed SankyRed added @aws-cdk/aws-stepfunctions Related to AWS StepFunctions and removed @aws-cdk/custom-resources Related to AWS CDK Custom Resources labels Sep 25, 2023
@mergify mergify bot closed this as completed in #27306 Oct 11, 2023
mergify bot pushed a commit that referenced this issue Oct 11, 2023
Closes #23532

----

*By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
@github-actions
Copy link

⚠️COMMENT VISIBILITY WARNING⚠️

Comments on closed issues are hard for our team to see.
If you need more assistance, please either tag a team member or open a new issue that references this one.
If you wish to keep having a conversation with other community members under this issue feel free to do so.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
@aws-cdk/aws-stepfunctions Related to AWS StepFunctions effort/small Small work item – less than a day of effort feature-request A feature should be added or improved. good first issue Related to contributions. See CONTRIBUTING.md p1
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants