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

[pipelines/core] Pipeline stuck if automatic references removed #10172

Closed
rix0rrr opened this issue Sep 4, 2020 · 4 comments
Closed

[pipelines/core] Pipeline stuck if automatic references removed #10172

rix0rrr opened this issue Sep 4, 2020 · 4 comments
Assignees
Labels
@aws-cdk/core Related to core CDK functionality @aws-cdk/pipelines CDK Pipelines library effort/large Large work item – several weeks of effort feature-request A feature should be added or improved. p1

Comments

@rix0rrr
Copy link
Contributor

rix0rrr commented Sep 4, 2020

Let's say there are 2 stacks and they are deployed in a pipeline, with an automatic cross-stack reference between them:

                   deploy order                       
─────────────────────────────────────────────────────▶
                                                      
  ┌──────────────┐                ┌──────────────┐    
  │              │                │              │    
  │   Producer   │◀───────────────│   Consumer   │    
  │              │  { Fn::Import  │              │    
  └──────────────┘     Value }    └──────────────┘    

Removal of the use of a cross-stack reference is going to lead to the Export being removed from the producer stack in the new template.

However, in the pipeline the Producer stack will be deployed before the Consumer stack, and at that point it's not allowed to remove the Export yet as the Consumer that's currently deployed still depends on it.

The pipeline is therefore stuck, and there's no way to work around this.

With the CLI, this is not a giant issue as one can manually deploy the Consumer first to remove the reference, and then deploy as normal.

The best way around this is probably to switch to weak references everywhere, otherwise I don't see a solution.


This is a 🚀 Feature Request

@rix0rrr rix0rrr added p1 @aws-cdk/core Related to core CDK functionality feature-request A feature should be added or improved. effort/large Large work item – several weeks of effort needs-triage This issue or PR still needs to be triaged. @aws-cdk/pipelines CDK Pipelines library labels Sep 4, 2020
@rix0rrr rix0rrr added this to the [CDK Pipelines] GA milestone Sep 4, 2020
@rix0rrr rix0rrr changed the title [pipelines/core] Removing automatic references between stacks does not work in a pipeline context [pipelines/core] Pipeline stuck if automatic references removed Sep 4, 2020
@SomayaB SomayaB removed the needs-triage This issue or PR still needs to be triaged. label Sep 4, 2020
@rix0rrr
Copy link
Contributor Author

rix0rrr commented Sep 22, 2020

See also #7602

@rix0rrr
Copy link
Contributor Author

rix0rrr commented Nov 6, 2020

Adam's written a nice blog post about it: https://www.endoflineblog.com/cdk-tips-03-how-to-unblock-cross-stack-references

@rix0rrr rix0rrr closed this as completed Nov 6, 2020
@github-actions
Copy link

github-actions bot commented Nov 6, 2020

⚠️COMMENT VISIBILITY WARNING⚠️

Comments on closed issues are hard for our team to see.
If you need more assistance, please either tag a team member or open a new issue that references this one.
If you wish to keep having a conversation with other community members under this issue feel free to do so.

@justin8
Copy link
Contributor

justin8 commented Nov 7, 2020

@rix0rrr id argue that this has a workaround, but I don’t see how to use that workaround within a CDK pipeline since you don’t directly have access to easily deploy one stack at a time in there. Should this be closed?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
@aws-cdk/core Related to core CDK functionality @aws-cdk/pipelines CDK Pipelines library effort/large Large work item – several weeks of effort feature-request A feature should be added or improved. p1
Projects
None yet
Development

No branches or pull requests

3 participants