question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

@aws-cdk/aws-codepipeline-actions: Parameter not usable in actionName

See original GitHub issue

Cloudformation parameters are not usable in action names.

Reproduction Steps

const projectNameToken = new CfnParameter(this, 'projectName', {
    type: 'String',
});
const sourceAction = new CodeCommitSourceAction({
    actionName: `${projectNameToken.valueAsString}-pipeline-source`,
    repository: repo,
    output: artifact
});

What did you expect to happen?

The parameter is used for the creation of the actionName.

What actually happened?

Unrecognized token key error:

/home/xxxx/cdk/cdk-pipeline/node_modules/@aws-cdk/core/lib/private/token-map.ts:165
      throw new Error(`Unrecognized token key: ${key}`);
            ^
Error: Resolution error: Resolution error: Resolution error: Resolution error: Unrecognized token key: TOKEN189.
Object creation stack:
  at Execute again with CDK_DEBUG=true to capture stack traces.
Object creation stack:
  at Execute again with CDK_DEBUG=true to capture stack traces..
    at TokenMap.lookupToken (/home/xxxx/cdk/cdk-pipeline/node_modules/@aws-cdk/core/lib/private/token-map.ts:165:13)
    at TokenString.split (/home/xxxx/cdk/cdk-pipeline/node_modules/@aws-cdk/core/lib/private/encoding.ts:55:20)
    at resolve (/home/xxxx/cdk/cdk-pipeline/node_modules/@aws-cdk/core/lib/private/resolve.ts:169:29)
    at Object.resolve (/home/xxxx/cdk/cdk-pipeline/node_modules/@aws-cdk/core/lib/private/resolve.ts:119:77)
    at resolve (/home/xxxx/cdk/cdk-pipeline/node_modules/@aws-cdk/core/lib/private/resolve.ts:230:47)
    at Object.resolve (/home/xxxx/cdk/cdk-pipeline/node_modules/@aws-cdk/core/lib/private/resolve.ts:119:77)
    at /home/xxxx/cdk/cdk-pipeline/node_modules/@aws-cdk/core/lib/private/resolve.ts:200:45
    at Array.map (<anonymous>)
    at resolve (/home/xxxx/cdk/cdk-pipeline/node_modules/@aws-cdk/core/lib/private/resolve.ts:200:8)
    at Object.resolve (/home/xxxx/cdk/cdk-pipeline/node_modules/@aws-cdk/core/lib/private/resolve.ts:119:77)

Environment

  • CDK CLI Version : 1.123.0 (build fad855e)
  • Framework Version:
  • Node.js Version: v14.17.6
  • OS : Ubuntu 20.04 (WSL2)
  • Language (Version): TypeScript (4.4.3)

This is 🐛 Bug Report

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
rafiwichtcommented, Sep 24, 2021

Yes, maybe the documentation is the fastest solution. I will look into it next week.

0reactions
github-actions[bot]commented, Sep 24, 2022

This issue has not received any attention in 1 year. If you want to keep this issue open, please leave a comment below and auto-close will be canceled.

Read more comments on GitHub >

github_iconTop Results From Across the Web

ASP.Net WebAPI ActionName Route Not Found - Stack Overflow
I was able to solve this by adding the Route property with HttpGet and renaming all of my functions to unique names like...
Read more >
Routing and Action Selection in ASP.NET Web API
The route dictionary does not contain an entry for "action", so we don't need to match the action name. Next, we try to...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found