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

(module name): (short issue description) #20201

Closed
mvolhontseff opened this issue May 3, 2022 · 4 comments
Closed

(module name): (short issue description) #20201

mvolhontseff opened this issue May 3, 2022 · 4 comments
Assignees
Labels
bug This issue is a bug. closing-soon This issue will automatically close in 4 days unless further comments are made. needs-reproduction This issue needs reproduction. needs-triage This issue or PR still needs to be triaged. package/tools Related to AWS CDK Tools or CLI response-requested Waiting on additional info and feedback. Will move to "closing-soon" in 7 days.

Comments

@mvolhontseff
Copy link

Describe the bug

Lang: python

Attempting to remove bootstrapped version rules etc from final synthesized yaml templates by customizing the Default Synthesizer; i.e.:

cdk.DefaultStackSynthesizer(generate_bootstrap_version_rule=False)

vpc_stack = Vpc(app, "MyStack", synthesizer=DISABLE_BOOTSTRAP)

A fresh cdk template synthesis, however, still contains bootstrap rules.

The intent is to allow for independent template execution via means other than the cdk CLI (i.e. aws cloudformation cli or console)

Expected Behavior

Synthesis of templates should exclude bootstrapping rules when the behavior of the default synthesizer is modified accordingly.

Current Behavior

Synthesis of bootstrapping rules seems entirely unaffected, regardless of synthesizer config; i.e.:

DISABLE_BOOTSTRAP = cdk.BootstraplessSynthesizer()
DISABLE_BOOTSTRAP = cdk.DefaultStackSynthesizer(generate_bootstrap_version_rule=False)
DISABLE_BOOTSTRAP = cdk.LegacyStackSynthesizer()

Reproduction Steps

Use cdk init to create basic project.

Use generate_bootstrap_version_rule=False as mentioned above when creating a Stack instance.

Use cdk synth to synthesize template; examine script output to confirm that bootstrapping rules are still present.

Possible Solution

unsure

Additional Information/Context

No response

CDK CLI Version

2.20.0

Framework Version

No response

Node.js Version

v18.0.0

OS

macos

Language

Python

Language Version

Python 3.9.12

Other information

No response

@mvolhontseff mvolhontseff added bug This issue is a bug. needs-triage This issue or PR still needs to be triaged. labels May 3, 2022
@github-actions github-actions bot added the package/tools Related to AWS CDK Tools or CLI label May 3, 2022
@rix0rrr
Copy link
Contributor

rix0rrr commented May 9, 2022

Does not repro for me, it works correctly:

from aws_cdk import Stack, DefaultStackSynthesizer
from constructs import Construct

class Testpy2Stack(Stack):
    def __init__(self, scope: Construct, construct_id: str, **kwargs) -> None:
        super().__init__(scope, construct_id,
            synthesizer=DefaultStackSynthesizer(generate_bootstrap_version_rule=False))

Are you passing through the **kwargs correctly?

@rix0rrr rix0rrr added needs-reproduction This issue needs reproduction. response-requested Waiting on additional info and feedback. Will move to "closing-soon" in 7 days. labels May 9, 2022
@github-actions
Copy link

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.

@github-actions github-actions bot added the closing-soon This issue will automatically close in 4 days unless further comments are made. label May 11, 2022
@mvolhontseff
Copy link
Author

@rix0rrr

You're correct, I wasn't passing **kwargs correctly to the Stack parent class via super().

Once I made the adjustment in the my class def, everything worked as expected. Then I ran into this issue, which I noticed your comments on and was able to resolve as well by using multiple instances of DefaultStackSynthesizer within app.py.

Thank you for your help on this.

@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
bug This issue is a bug. closing-soon This issue will automatically close in 4 days unless further comments are made. needs-reproduction This issue needs reproduction. needs-triage This issue or PR still needs to be triaged. package/tools Related to AWS CDK Tools or CLI response-requested Waiting on additional info and feedback. Will move to "closing-soon" in 7 days.
Projects
None yet
Development

No branches or pull requests

2 participants