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

[core] Only One Stack per Stacksynthesizer possible? #11528

Closed
markussiebert opened this issue Nov 17, 2020 · 3 comments · Fixed by #11635
Closed

[core] Only One Stack per Stacksynthesizer possible? #11528

markussiebert opened this issue Nov 17, 2020 · 3 comments · Fixed by #11635
Assignees
Labels
@aws-cdk/core Related to core CDK functionality bug This issue is a bug. effort/small Small work item – less than a day of effort p1

Comments

@markussiebert
Copy link
Contributor

markussiebert commented Nov 17, 2020

In my testcases i saw the behaviour, that only one stack per stack synthesizer is possible. If I create more than one stack per app with the same synthesizer, only the last stack is known to cdk.

Reproduction Steps

new Stack1(app, 'Stack1', {
    env: ENV,
    synthesizer: SYNTHESIZER,
});

new Stack2(app, 'Stack2', {
    env: ENV, 
    synthesizer: SYNTHESIZER,
});

cdk list 

Stack2

Removing the synthesizer from one of the stacks I can see both stacks ...

Further investigations:

The problem is that I'm reusing the same synthesizer for several stacks. Using different objects (with the same content) as stack synthesizers works like expected. So I'm not sure if this is a bug?

What did you expect to happen?

I expected to see all Stacks ...

What actually happened?

I only see the last stack defined per Synthesizer

Environment

cdk 1.73.0

This is 🐛 Bug Report

@markussiebert markussiebert added bug This issue is a bug. needs-triage This issue or PR still needs to be triaged. labels Nov 17, 2020
@SomayaB SomayaB changed the title [cdk] Only One Stack per Stacksynthesizer possible? [core] Only One Stack per Stacksynthesizer possible? Nov 18, 2020
@github-actions github-actions bot added the @aws-cdk/core Related to core CDK functionality label Nov 18, 2020
@rix0rrr
Copy link
Contributor

rix0rrr commented Nov 23, 2020

It's how these objects currently behave. One could consider it a bug, and I feel you that this could have been checked.

But I agree with you that it's worth addressing. I think I might have an idea for it.

@rix0rrr rix0rrr added effort/small Small work item – less than a day of effort p1 labels Nov 23, 2020
@rix0rrr
Copy link
Contributor

rix0rrr commented Nov 23, 2020

Well unfortunately this is no longer fixable without breaking backwards compatibility :(.

rix0rrr added a commit that referenced this issue Nov 23, 2020
If the same StackSynthesizer object is used for multiple stacks,
only the last one is properly synthesized to the cloud assembly.

Ideally, we would have made it so that there is a difference between
the specifying `StackSynthesizer` object and a "bound" version of
the `StackSynthesizer` (bound to a `Stack`).

Unfortunately, we cannot introduce that change without heavy
contortions in order not to break backwards compatibility, so the
simple thing to do right now is to make it blindingly obvious that
"you cannot do that".

Fixes #11528.
@SomayaB SomayaB removed the needs-triage This issue or PR still needs to be triaged. label Nov 23, 2020
@mergify mergify bot closed this as completed in #11635 Nov 24, 2020
mergify bot pushed a commit that referenced this issue Nov 24, 2020
…1635)

If the same StackSynthesizer object is used for multiple stacks,
only the last one is properly synthesized to the cloud assembly.

Ideally, we would have made it so that there is a difference between
the specifying `StackSynthesizer` object and a "bound" version of
the `StackSynthesizer` (bound to a `Stack`).

Unfortunately, we cannot introduce that change without heavy
contortions in order not to break backwards compatibility, so the
simple thing to do right now is to make it blindingly obvious that
"you cannot do that".

Fixes #11528.


----

*By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
@github-actions
Copy link

⚠️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.

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 bug This issue is a bug. effort/small Small work item – less than a day of effort p1
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants