(codepipeline): Stack.crossRegionReferences fails with "aliasName: required but missing."
- Dominant language
- TypeScript
- Stars
- 12.9k
- Forks
- 4.6k
- Avg merge
- 2d 3h
- Merged PRs (30d)
- 83
Description
### Describe the bug
I understand `crossRegionReferences` is experimental, but I'd expect to actually get it deployed.
The problem seems related to the `CrossRegionSupportStack`. The most relevant part of the stack trace looks like:
```
aws-cdk-lib/aws-kms/lib/kms.generated.js:1:2998)
at CfnAlias.renderProperties
```
### Expected Behavior
No error when using cross-region CodePipeline action.
### Current Behavior
```
Error: Resolution error: Supplied properties not correct for "CfnAliasProps"
aliasName: required but missing.
Trace: Error: Resolution error: Supplied properties not correct for "CfnAliasProps"
aliasName: required but missing.
at ValidationResult.assertSuccess (node_modules/.pnpm/aws-cdk-lib@2.95.1_constructs@10.1.156/node_modules/aws-cdk-lib/core/lib/runtime.js:1:2643)
at convertCfnAliasPropsToCloudFormation (node_modules/.pnpm/aws-cdk-lib@2.95.1_constructs@10.1.156/node_modules/aws-cdk-lib/aws-kms/lib/kms.generated.js:1:2998)
at CfnAlias.renderProperties (node_modules/.pnpm/aws-cdk-lib@2.95.1_constructs@10.1.156/node_modules/aws-cdk-lib/aws-kms/lib/kms.generated.js:1:1885)
at PostResolveToken.Resources [as processor] (node_modules/.pnpm/aws-cdk-lib@2.95.1_constructs@10.1.156/node_modules/aws-cdk-lib/core/lib/cfn-resource.js:1:7100)
at PostResolveToken.postProcess (node_modules/.pnpm/aws-cdk-lib@2.95.1_constructs@10.1.156/node_modules/aws-cdk-lib/core/lib/util.js:1:1565)
at Object.postProcess (node_modules/.pnpm/aws-cdk-lib@2.95.1_constructs@10.1.156/node_modules/aws-cdk-lib/core/lib/private/resolve.js:1:1018)
at DefaultTokenResolver.resolveToken (node_modules/.pnpm/aws-cdk-lib@2.95.1_constructs@10.1.156/node_modules/aws-cdk-lib/core/lib/resolvable.js:1:1320)
at resolve (node_modules/.pnpm/aws-cdk-lib@2.95.1_constructs@10.1.156/node_modules/aws-cdk-lib/core/lib/private/resolve.js:1:2510)
at Object.resolve (node_modules/.pnpm/aws-cdk-lib@2.95.1_constructs@10.1.156/node_modules/aws-cdk-lib/core/lib/private/resolve.js:1:892)
at resolve (node_modules/.pnpm/aws-cdk-lib@2.95.1_constructs@10.1.156/node_modules/aws-cdk-lib/core/lib/private/resolve.js:1:2787)
at Object.resolve (node_modules/.pnpm/aws-cdk-lib@2.95.1_constructs@10.1.156/node_modules/aws-cdk-lib/core/lib/private/resolve.js:1:892)
at resolve (node_modules/.pnpm/aws-cdk-lib@2.95.1_constructs@10.1.156/node_modules/aws-cdk-lib/core/lib/private/resolve.js:1:2787)
at CrossRegionSupportStack.resolve (node_modules/.pnpm/aws-cdk-lib@2.95.1_constructs@10.1.156/node_modules/aws-cdk-lib/core/lib/stack.js:1:6002)
at node_modules/.pnpm/aws-cdk-lib@2.95.1_constructs@10.1.156/node_modules/aws-cdk-lib/core/lib/stack.js:1:18206
at Array.map ()
at CrossRegionSupportStack._toCloudFormation (node_modules/.pnpm/aws-cdk-lib@2.95.1_constructs@10.1.156/node_modules/aws-cdk-lib/core/lib/stack.js:1:18194)
at CrossRegionSupportStack._synthesizeTemplate (node_modules/.pnpm/aws-cdk-lib@2.95.1_constructs@10.1.156/node_modules/aws-cdk-lib/core/lib/stack.js:1:12593)
at DefaultStackSynthesizer.synthesizeTemplate (node_modules/.pnpm/aws-cdk-lib@2.95.1_constructs@10.1.156/node_modules/aws-cdk-lib/core/lib/stack-synthesizers/stack-synthesizer.js:1:1699)
at DefaultStackSynthesizer.synthesize (node_modules/.pnpm/aws-cdk-lib@2.95.1_constructs@10.1.156/node_modules/aws-cdk-lib/core/lib/stack-synthesizers/default-synthesizer.js:1:6211)
at node_modules/.pnpm/aws-cdk-lib@2.95.1_constructs@10.2.69/node_modules/aws-cdk-lib/core/lib/private/synthesis.js:2:3407
at visit (node_modules/.pnpm/aws-cdk-lib@2.95.1_constructs@10.2.69/node_modules/aws-cdk-lib/core/lib/private/synthesis.js:4:368)
at visit (node_modules/.pnpm/aws-cdk-lib@2.95.1_constructs@10.2.69/node_modules/aws-cdk-lib/core/lib/private/synthesis.js:4:330)
at synthesizeTree (node_modules/.pnpm/aws-cdk-lib@2.95.1_constructs@10.2.69/node_modules/aws-cdk-lib/core/lib/private/synthesis.js:2:3251)
at synthesize (node_modules/.pnpm/aws-cdk-lib@2.95.1_constructs@10.2.69/node_modules/aws-cdk-lib/core/lib/private/synthesis.js:1:1083)
at App.synth (node_modules/.pnpm/aws-cdk-lib@2.95.1_constructs@10.2.69/node_modules/aws-cdk-lib/core/lib/stage.js:1:2052)
at Module.synth (node_modules/.pnpm/sst@2.25.1/node_modules/sst/stacks/synth.js:65:30)
at async node_modules/.pnpm/sst@2.25.1/node_modules/sst/cli/commands/deploy.js:80:28
at async Object.handler (node_modules/.pnpm/sst@2.25.1/node_modules/sst/cli/commands/deploy.js:71:26)
at process. (node_modules/.pnpm/sst@2.25.1/node_modules/sst/cli/sst.js:62:21)
at process.emit (node:events:525:35)
at process.emit (node:domain:489:12)
at process._fatalException (node:internal/process/execution:149:25)
at processPromiseRejections (node:internal/process/promises:279:13)
at processTicksAndRejections (node:internal/process/task_queues:97:32)
```
### Reproduction Steps
CodePipeline construct with an existing `Project.fromProjectArn()` CodeBuild Project in a different region than the pipeline. Attempt to deploy.
https://github.com/closesimple-wl/codepipeline-repro
### Possible Solution
_No response_
### Additional Information/Context
_No response_
### CDK CLI Version
2.95.1 (build ae455d8)
### Framework Version
_No response_
### Node.js Version
16
### OS
macOS 13.4
### Language
Typescript
### Language Version
_No response_
### Other information
_No response_
Contributor guide
Research direction
Start with the linked codepipeline reproduction and the CrossRegionSupportStack path used when a CodePipeline references Project.fromProjectArn() in another region. Reproduce the deployment with CDK CLI 2.95.1 and inspect the generated KMS CfnAlias properties around the reported aliasName validation error. Done means the cross-region CodePipeline synthesizes and deploys without the missing aliasName error.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- aws, node.js, typescript
- Domain
- build-system, cloud, devops
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100