CDK Bootstrapless Synthesizer

raw JSON →
2.3.2 verified Sat May 09 auth: no python

A bootstrapless synthesizer for the AWS Cloud Development Kit (CDK) v2 that generates directly usable CloudFormation templates without requiring a CDK bootstrap stack. Version 2.3.2, maintains compatibility with CDK v2.

pip install cdk-bootstrapless-synthesizer
error ImportError: cannot import name 'BootstraplessSynthesizer' from 'cdk_bootstrapless_synthesizer'
cause Installed version is too old (pre-2.0) or the import path is incorrect.
fix
Ensure you have version >=2.0.0 and import using from cdk_bootstrapless_synthesizer import BootstraplessSynthesizer.
error AttributeError: 'BootstraplessSynthesizer' object has no attribute '_synthesize'
cause Using deprecated synthesize() method with incorrect signature.
fix
Use the new pattern: pass parameters to the constructor instead of calling synthesize().
error jsii.errors.JSIIError: 'BootstraplessSynthesizer' cannot be used with this CDK version
cause Mixing CDK v1 and v2 packages.
fix
Ensure all CDK dependencies are from aws-cdk-lib (v2) not @aws-cdk/*.
gotcha The BootstraplessSynthesizer requires CDK v2. Using it with CDK v1 will cause import errors.
fix Upgrade to aws-cdk-lib >=2.0.0.
gotcha If you use a custom BootstrapRole or fileAssetsBucketName, you must specify them in the synthesizer properties. Otherwise the synthesized template will fail to deploy due to missing parameters.
fix Explicitly pass required parameters: BootstraplessSynthesizer(fileAssetsBucketName='my-bucket', ...).
deprecated The method BootstraplessSynthesizer.synthesize() is deprecated in favor of using __init__ parameters. Directly calling synthesize() with arguments may break in future versions.
fix Use the constructor to configure the synthesizer instead.

Create a CDK app with a bootstrapless synthesizer so the template can be deployed without a pre-existing bootstrap stack.

from aws_cdk import App, Stack
from cdk_bootstrapless_synthesizer import BootstraplessSynthesizer

app = App()
stack = Stack(app, "MyStack", synthesizer=BootstraplessSynthesizer())
app.synth()