-
Notifications
You must be signed in to change notification settings - Fork 3.9k
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
codepipeline-actions: Github connection, allow Token values #27100
Comments
We need to be able to parse the value at runtime, this error is explicitly thrown by us if the values supplied are tokens
We don't call this out in the documentation, we need to add this to the
|
…runtime (#27109) This PR addresses an issue encountered when setting up an AWS CDK pipeline where unresolved token values for the `repoString` parameter led to a runtime error. The updated docstring now explicitly mentions that the `repoString` must be resolvable at runtime and that unresolved tokens are intended to be a runtime error Closes #27100. Thanks to @peterwoodworth for the quick assessment and the proposed solution to the problem. ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
|
…runtime (#27109) This PR addresses an issue encountered when setting up an AWS CDK pipeline where unresolved token values for the `repoString` parameter led to a runtime error. The updated docstring now explicitly mentions that the `repoString` must be resolvable at runtime and that unresolved tokens are intended to be a runtime error Closes #27100. Thanks to @peterwoodworth for the quick assessment and the proposed solution to the problem. ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
I can confirm the same thing happens when using the code below to connect to a Bitbucket repo with cloudformation parameters that are tokenized (RepositoryName, Environment, ConnectionArn). // Parameters
const Environment = new cdk.CfnParameter(this, "Environment", {
type: "String",
description: "The development environment / repository branch name.",
})
const RepositoryName = new cdk.CfnParameter(this, "RepositoryName", {
type: "String",
description: "The code source repository name.",
})
const RepositoryConnectionArn = new cdk.CfnParameter(this, "RepositoryConnectionArn", {
type: "String",
description: "The code source CodeStar connection Arn. The connection must be configured BEFORE deployment.",
})
// Resources
const pipeline = new CodePipeline(this, "Pipeline", {
pipelineName: `Deployment-Pipeline-${Environment.valueAsString}`,
synth: new ShellStep("Synth", {
input: CodePipelineSource.connection(RepositoryName.valueAsString, Environment.valueAsString, {
connectionArn: RepositoryConnectionArn.valueAsString,
}),
commands: ["cdk synth"],
}),
}) |
Describe the bug
While setting up an AWS CDK pipeline using the pipelines.CodePipelineSource.connection method, I encountered an error indicating that the Step id cannot be unresolved. Specifically, it failed on a tokenized value
${Token[TOKEN.653]}/${Token[TOKEN.656]}
, which seems to be originating from the SSM parametersgithubOwner
andgithubRepo
.Expected Behavior
The AWS CDK pipeline should be able to resolve and handle the tokenized values from SSM parameters seamlessly, without throwing an error related to the unresolved Step id.
Current Behavior
When trying to synthesize the pipeline stack, the process fails with the error message:
Reproduction Steps
Set up an AWS CDK stack with parameters fetched from SSM.
Use these parameters in the pipelines.CodePipelineSource.connection method to define the source input.
Attempt to synthesize or deploy the stack.
Possible Solution
No response
Additional Information/Context
No response
CDK CLI Version
2.94.0
Framework Version
No response
Node.js Version
18.16.0
OS
Ubuntu 22.04
Language
Typescript
Language Version
Typescript ~5.0.3
Other information
Not really anything too important it was just weird that this wouldnt work.
Especially since a similar pattern can be used for source actions
The text was updated successfully, but these errors were encountered: