Skip to content

cli: a cdk diff with analyticsReporting: false and an empty stack will always print [+] Parameter BootstrapVersion  #31864

Open
@rehanvdm

Description

Describe the bug

When setting analyticsReporting: false on a stack and that has no resources, the diff always reports as if it still wants to add the boostrap ssm param to that stack.

  Stack security--audit--regional--us-east-1 (dlz-regional)
  Hold on while we create a read-only change set to get a diff with accurate replacement information (use --no-change-set to use a less accurate but faster template-only diff)
  Could not create a change set, will base the diff on template differences (run again with -v to see the reason)
  Parameters
  [+] Parameter BootstrapVersion BootstrapVersion: {"Type":"AWS::SSM::Parameter::Value<String>","Default":"/cdk-bootstrap/hnb659fds/version","Description":"Version of the CDK Bootstrap resources in this environment, automatically retrieved from SSM Parameter Store. [cdk:skip]"}

  Other Changes
  [+] Unknown Rules: {"CheckBootstrapVersion":{"Assertions":[{"Assert":{"Fn::Not":[{"Fn::Contains":[["1","2","3","4","5"],{"Ref":"BootstrapVersion"}]}]},"AssertDescription":"CDK bootstrap stack version 6 required. Please run 'cdk bootstrap' with a recent version of the CDK CLI."}]}}

But when you deploy the stack, it won't be created because the deploy commands knows that the stack has no resources and it won't add the version ssm param.

security--log--regional--us-east-1 (dlz-regional)
security--log--regional--us-east-1 (dlz-regional): stack has no resources, skipping deployment.

The logic of skipping a stack deployment must be applied to the diff the same as it is being applied to the deploy command

Regression Issue

  • Select this option if this issue appears to be a regression.

Last Known Working CDK Version

No response

Expected Behavior

The logic of skipping a stack deployment must be applied to the diff the same as it is being applied to the deploy command

Current Behavior

The logic for the diff and deploy commands differ

Reproduction Steps

  1. Create an empty stack, specify the analyticsReporting: false option.
  2. Do a diff and a deploy compare the results

Possible Solution

No response

Additional Information/Context

No response

CDK CLI Version

2.133.0

Framework Version

No response

Node.js Version

OS

Language

TypeScript

Language Version

No response

Other information

No response

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    @aws-cdk/coreRelated to core CDK functionalitybugThis issue is a bug.effort/mediumMedium work item – several days of effortp2package/toolsRelated to AWS CDK Tools or CLI

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions