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

Cannot use cdk.Token in the codepipeline.Pipeline #1788

Closed
piotrkubisa opened this issue Feb 19, 2019 · 1 comment · Fixed by #1800
Closed

Cannot use cdk.Token in the codepipeline.Pipeline #1788

piotrkubisa opened this issue Feb 19, 2019 · 1 comment · Fixed by #1800
Labels
@aws-cdk/aws-codepipeline Related to AWS CodePipeline bug This issue is a bug.

Comments

@piotrkubisa
Copy link

piotrkubisa commented Feb 19, 2019

During creation of the CodePipeline CI/CD pipeline I noticed it is not possible to use cdk.Token values in the pipelineName, because following property is always validated against string.

Having following configuration (this = cdk.Stack)...:

    const pipeline = new codepipeline.Pipeline(this, 'Pipeline', {
      pipelineName: this.stackName,
      artifactBucket,
    })

... I will encounter following command when trying to synthesize template:

/some_project/_cdk/node_modules/@aws-cdk/aws-codepipeline-api/lib/validation.ts:48
    throw new Error(`${thing} name must match regular expression: ${VALID_IDENTIFIER_REGEX.toString()}, got '${name}'`);
          ^
Error: Pipeline name must match regular expression: /^[a-zA-Z0-9.@_-]{1,100}$/, got '${Token[my-stack.AWS::StackName.79]}'
    at Object.validateName (/some_project/_cdk/node_modules/@aws-cdk/aws-codepipeline-api/lib/validation.ts:48:11)

May cdk.Token be whitelisted as a value for pipelineName property?

@eladb
Copy link
Contributor

eladb commented Feb 19, 2019

Yes, we should not validate the name if it's a token (cdk.unresolved would return true in that case and we should forgo validation).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
@aws-cdk/aws-codepipeline Related to AWS CodePipeline bug This issue is a bug.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants