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

(codepipeline): Stack.crossRegionReferences fails with "aliasName: required but missing." #27137

Open
closesimple-wl opened this issue Sep 14, 2023 · 4 comments
Labels
@aws-cdk/aws-codepipeline Related to AWS CodePipeline bug This issue is a bug. p2

Comments

@closesimple-wl
Copy link

closesimple-wl commented Sep 14, 2023

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 (<anonymous>)
    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.<anonymous> (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

@closesimple-wl closesimple-wl added bug This issue is a bug. needs-triage This issue or PR still needs to be triaged. labels Sep 14, 2023
@github-actions github-actions bot added the @aws-cdk/aws-codepipeline Related to AWS CodePipeline label Sep 14, 2023
@peterwoodworth
Copy link
Contributor

Could you provide minimal reproduction code please? I'm not sure how you have this setup in CDK

@peterwoodworth peterwoodworth added response-requested Waiting on additional info and feedback. Will move to "closing-soon" in 7 days. and removed needs-triage This issue or PR still needs to be triaged. labels Sep 14, 2023
@closesimple-wl
Copy link
Author

Minimal-ish reproduction repo: https://github.com/closesimple-wl/codepipeline-repro

@github-actions github-actions bot removed the response-requested Waiting on additional info and feedback. Will move to "closing-soon" in 7 days. label Sep 15, 2023
@closesimple-wl
Copy link
Author

I realize the reproduction repo's code isn't the correct approach because I need a separate stack for the other region's resource(s). But even after stripping it down to direct cdk synthesize on a single App with two Stack, the error message is the same.

So regardless of the example code not being correct according to

You can enable the Stack property `crossRegionReferences`
, this still appears to be a real bug.

@vibhavsinha
Copy link

Is there any workaround for this problem?

@pahud pahud added p2 and removed p1 labels Jun 11, 2024
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. p2
Projects
None yet
Development

No branches or pull requests

4 participants