-
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): CrossRegionSupportStack Stack name must match the regular expression #31436
Comments
Hey @jsunico , thanks for reaching out.
Found somewhat similar issue in the past - #23098 |
This issue has not received a response in a while. If you want to keep this issue open, please leave a comment below and auto-close will be canceled. |
Hi @khushail, so I tried to reproduce it in a new project here: https://github.com/jsunico/aws-cdk-repro-cross-region-action-in-pipeline I started off with just a single stack which is generated by This is the error you'll get when running
From the error above, it seems that the method below is not getting the correct pipelineStackName. In a single stack setup, it can successfully get the stack name but in a nested stack setup it is returning |
Hi @jsunico , thanks for sharing the repro code and your investigation. I found various related issues around this one ,sharing few of those - Although relative PRs have been merged but this CrossAccountRegion deployment is causing the issue. I faced the sImilar issue when tried to deploy the code shared by you. I checked all the Pipeline related guidelines, still getting this issue - This surely seems a bug. I am marking it as P1, requesting further action/inputs from the core team. |
@jsunico I took a deep dive into the code and I see the main source of issue is with the nested stack you used. When nested stack is used, the stack name becomes a Token representation and does not resolve until deployment. This would then fail in the check in
I'd like to understand is there any specific reason you want to use Nested stack in this case. If you change |
Hi @GavinZZ, thanks for taking a deeper look into this issue. We do deploy big applications using CDK and we tend to break down or group resources using NestedStacks. We would have a root stack and a few nested stacks like (network-layer, application-layer, data-layer, pipeline-layer). In my understanding this is the best practice in managing multiple stacks within CDK. Could you please point me to the correct documentation if I have misunderstood? Thank you. |
@jsunico There isn't any documentation around best practices of using nested stack in CDK. According to CFN documentation, one of the key benefits of using nested stack is From CDK's perspective, I don't see much benefits of using nested stack. If a stack is anywhere close to 500 resource limits, the stack should be split into regular sub-stacks instead of using nested stacks as the solution given how you can simply export a resource and reference the resource from a different stack easily in CDK, like the following:
|
Comments on closed issues and PRs are hard for our team to see. |
…ame is unresolved token (aws#31967) ### Issue # (if applicable) Closes aws#31436. ### Reason for this change When nested stack is used with CodePipeline, the stack name is actually a token which will fail regex check. We can't simply add a `Token.isUnresolved` check before the regex check because stack name must be a resolved string otherwise the template file would include `Token[xxx]`. ### Description of changes The only feasible fix would be allowing users to override the nested stack name if users provide one. Currently nested stack names are auto-generated and are a token value. Allow users to specify the stack name. ### Description of how you validated changes New integ tests pass. Existing tests pass. ### Checklist - [ ] My code adheres to the [CONTRIBUTING GUIDE](https://github.com/aws/aws-cdk/blob/main/CONTRIBUTING.md) and [DESIGN GUIDELINES](https://github.com/aws/aws-cdk/blob/main/docs/DESIGN_GUIDELINES.md) ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
Describe the Bug
I have a State Machine from another region that is being imported to CDK via StateMachine.fromStateMachineArn. When this state machine is added as cross-region StepFunctionInvokeAction to the pipeline an error is thrown.
Regression Issue
Last Known Working CDK Version
No response
Expected Behavior
Cross-region action can be added to the pipeline.
Current Behavior
Reproduction Steps
Possible Solution
NA
Additional Information/Context
No response
CDK CLI Version
2.158.0
Framework Version
No response
Node.js Version
18.20.4
OS
WSL Ubuntu 20
Language
TypeScript
Language Version
~4.6.4
Other information
No response
The text was updated successfully, but these errors were encountered: