Closed huyphan closed 2 years ago
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.
Describe the bug
We have a setup that we don't rely on a bootstrap stack at all (i.e. we don't use
CDKToolkit
or any custom toolkit stack). We specifically omit the propertyrequiresBootstrapStackVersion
in the asset manifest. But when runningcdk deploy <stack-name>
, we saw that CDK still tries to validate the bootstrap stack and subsequently fails the deployment.This behaviour is caused by the
AssetManifestArtifact
class whererequiresBootstrapStackVersion
is a required property of typenumber
. Even if the custom synthesizer returnsundefined
(ornull
) for this property,AssetManifestArtifact
will override it to1
. This causes the bootstrap stack version validation to happen in other operations.This is only an issue with asset manifest artifact, but not with cloudformation artifact.
Expected Behavior
cdk deploy <stackname>
should work without the need to validate the bootstrap stack.Current Behavior
cdk deploy <stackname>
command fails with the following error:Reproduction Steps
We have a custom synthesizer that's rather large to copy-paste here, but here's an example of the asset manifest that our synthesizer produces:
Notice that the manifests completely omit the
requiresBootstrapStackVersion
andbootstrapStackVersionSsmParameter
properties.Possible Solution
There are many ways to address this, two options that I can think of:
Option 1: Updating the constructor of
AssetManifestArtifact
to allowrequireBootstrapStackVersion
to beundefined
:This change makes the behaviour of
AssetManifestArtifact
consistent withCloudFormationStackArtifact
:This change is technically backward incompatible. It will break those who write their own synthesizers, omit the
requiresBootstrapStackVersion
property but still require a bootstrap stack behind the scene. If that use case exists, it's probably a wrong usage in the first place.Option 2: Extending
requireBootstrapStackVersion
field to accept boolean values and relax the check on that field when deploying:Option 3: Using
0
as a special value ofrequireBootstrapStackVersion
:This is also a backward incompatible change. Version
0
implicitly represents the legacy bootstrap stack. WhenrequireBootstrapStackVersion
is set to 0, the current behaviour is to still check for the existence of the CDKToolkit stack, but do not care what version it is. With this code change, we will remove the checks entirely.Additional Information/Context
No response
CDK CLI Version
5.33.0 (build 859272d)
Framework Version
No response
Node.js Version
v16.14.2
OS
Darwin Kernel Version 21.6.0
Language
Typescript
Language Version
No response
Other information
No response