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): State machine does not allow token in its name #13912

Closed
supergillis opened this issue Mar 31, 2021 · 3 comments
Closed
Assignees
Labels
@aws-cdk/aws-stepfunctions Related to AWS StepFunctions bug This issue is a bug. needs-triage This issue or PR still needs to be triaged.

Comments

@supergillis
Copy link

supergillis commented Mar 31, 2021

It's not possible to have a token in a state machine name after upgrading from CDK v1.91.0 to v1.95.1.

Reproduction Steps

new stepfunctions.StateMachine(this, 'StateMachine', {
  stateMachineName: `${cdk.Aws.STACK_NAME}-Machine`,
});

What did you expect to happen?

The state machine should be created with the name of the stack plus -Machine.

What actually happened?

The following error occured:

State Machine name must match "^[0-9a-zA-Z+!@._-]+$". Received: ${Token[AWS.StackName.9]}-Machine

Environment

  • CDK CLI Version: 1.95.1
  • Framework Version: 1.95.1
  • Node.js Version: v14.16.0
  • OS: OS X
  • Language (Version): TypeScript

Other

Introduced in PR #13387.

Validate that the state machine name is not a token and then perform the validation.

if (stateMachineName.length < 1 || stateMachineName.length > 80) {

The following workaround can be used temporarily.

const machine = new stepfunctions.StateMachine(this, 'StateMachine', {
    // stateMachineName: `${cdk.Aws.STACK_NAME}-Machine`,
});
(this.resource.node.defaultChild as cdk.CfnResource).addPropertyOverride('StateMachineName', `${cdk.Aws.STACK_NAME}-Machine`);

This is 🐛 Bug Report

@supergillis supergillis added bug This issue is a bug. needs-triage This issue or PR still needs to be triaged. labels Mar 31, 2021
@github-actions github-actions bot added the @aws-cdk/aws-stepfunctions Related to AWS StepFunctions label Mar 31, 2021
@supergillis supergillis changed the title (stepfunctions): State machine does not allow token in its name (aws-stepfunctions): State machine does not allow token in its name Mar 31, 2021
mergify bot pushed a commit that referenced this issue Apr 8, 2021
…re used. (#13970)

Name validation for state machines was added in #13387. The validation added was not considering that the name may contain an unresolved token. This change skips name validation if there is an unresolved token as it does not make sense to attempt to validate something that is unknown. This change also allows a few more special characters as they are allowed through the AWS Console.

fixes #13946 #13912


----

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

jstrese commented Apr 8, 2021

@shivlaks I think this issue can be closed - this is a duplicate of issue #13946 and resolved in PR #13970.

@shivlaks
Copy link
Contributor

shivlaks commented Apr 8, 2021

@jstrese I think you meant that it's fixed by #13970
thanks again for contributing the fix. resolving this issue.

@shivlaks shivlaks closed this as completed Apr 8, 2021
@github-actions
Copy link

github-actions bot commented Apr 8, 2021

⚠️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.

hollanddd pushed a commit to hollanddd/aws-cdk that referenced this issue Aug 26, 2021
…re used. (aws#13970)

Name validation for state machines was added in aws#13387. The validation added was not considering that the name may contain an unresolved token. This change skips name validation if there is an unresolved token as it does not make sense to attempt to validate something that is unknown. This change also allows a few more special characters as they are allowed through the AWS Console.

fixes aws#13946 aws#13912


----

*By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
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 bug This issue is a bug. needs-triage This issue or PR still needs to be triaged.
Projects
None yet
Development

No branches or pull requests

3 participants