aws / aws-cdk

The AWS Cloud Development Kit is a framework for defining cloud infrastructure in code
https://aws.amazon.com/cdk
Apache License 2.0
11.65k stars 3.91k forks source link

(cli): `cdk diff --template` >=2.133.0 crashes #29890

Closed toha-nordic closed 6 months ago

toha-nordic commented 6 months ago

Describe the bug

When using --template with cdk diff it crashes with CDK >=2.133.0 (tested up to 2.137.0):

cdk diff --exclusively --color -vvv --template tmp/backend-cd.template.json -a cdk.out --no-change-set backend-cd
...
Cannot convert undefined or null to object
[16:46:59] TypeError: Cannot convert undefined or null to object
    at Function.keys (<anonymous>)
    at calculateTemplateDiff (/home/toha/.nvm/versions/node/v18.19.1/lib/node_modules/aws-cdk/lib/index.js:394:52274)
    at diffTemplate (/home/toha/.nvm/versions/node/v18.19.1/lib/node_modules/aws-cdk/lib/index.js:394:50944)
    at Object.fullDiff (/home/toha/.nvm/versions/node/v18.19.1/lib/node_modules/aws-cdk/lib/index.js:394:50728)
    at printStackDiff (/home/toha/.nvm/versions/node/v18.19.1/lib/node_modules/aws-cdk/lib/index.js:433:166276)
    at CdkToolkit.diff (/home/toha/.nvm/versions/node/v18.19.1/lib/node_modules/aws-cdk/lib/index.js:433:193682)
    at async exec4 (/home/toha/.nvm/versions/node/v18.19.1/lib/node_modules/aws-cdk/lib/index.js:488:54378)

Expected Behavior

With CDK 2.132.0 it still works as before:

cdk diff --exclusively --color -vvv --template tmp/backend-cd.template.json -a cdk.out --no-change-set backend-cd
...
Resources
[~] AWS::Logs::LogGroup CodeBuildResultsLogGroup CodeBuildResultsLogGroup535329BA replace
 └─ [~] LogGroupName (requires replacement)
     ├─ [-] /aws/codebuild/202403261110
     └─ [+] /aws/codebuild/202404181350

✨  Number of stacks with differences: 1

Current Behavior

cdk diff --exclusively --color -vvv --template tmp/backend-cd.template.json -a cdk.out --no-change-set backend-cd
[17:00:30] CDK toolkit version: 2.133.0 (build dcc1e75)
[17:00:30] Command line arguments: {
  _: [ 'diff' ],
  exclusively: true,
  e: true,
  color: true,
  v: 3,
  verbose: 3,
  template: 'tmp/backend-cd.template.json',
  a: 'cdk.out',
  app: 'cdk.out',
  'change-set': false,
  changeSet: false,
  lookups: true,
  'ignore-errors': false,
  ignoreErrors: false,
  json: false,
  j: false,
  debug: false,
  ec2creds: undefined,
  i: undefined,
  'version-reporting': undefined,
  versionReporting: undefined,
  'path-metadata': undefined,
  pathMetadata: undefined,
  'asset-metadata': undefined,
  assetMetadata: undefined,
  'role-arn': undefined,
  r: undefined,
  roleArn: undefined,
  staging: true,
  'no-color': false,
  noColor: false,
  ci: false,
  'context-lines': 3,
  contextLines: 3,
  strict: false,
  'security-only': false,
  securityOnly: false,
  processed: false,
  quiet: false,
  q: false,
  '$0': 'cdk',
  STACKS: [ 'backend-cd' ],
  'S-t-a-c-k-s': [ 'backend-cd' ]
}
[17:00:30] cdk.json: {
  "app": "node --unhandled-rejections=strict dist/aws/deployment-app.js",
  "build": "yarn compile",
  "progress": "events"
}
[17:00:30] cdk.context.json: {
  "availability-zones:account=<account_number>:region=us-east-1": [
    "us-east-1a",
    "us-east-1b",
    "us-east-1c",
    "us-east-1d",
    "us-east-1e",
    "us-east-1f"
  ],
  "vpc-provider:account=<account_number>:filter.vpc-id=vpc-00fe623bb1cb307af:region=us-east-1:returnAsymmetricSubnets=true": {
    "vpcId": "vpc-00fe623bb1cb307af",
    "vpcCidrBlock": "10.0.0.0/16",
    "availabilityZones": [],
    "subnetGroups": [
      {
        "name": "Public",
        "type": "Public",
        "subnets": [
          {
            "subnetId": "subnet-0dcd6214a092e97bb",
            "cidr": "10.0.0.0/19",
            "availabilityZone": "us-east-1a",
            "routeTableId": "rtb-049bcd6081554adba"
          },
          {
            "subnetId": "subnet-0439f6c9f8173550d",
            "cidr": "10.0.32.0/19",
            "availabilityZone": "us-east-1b",
            "routeTableId": "rtb-001a243184f9a0bf6"
          },
          {
            "subnetId": "subnet-0c08d9ed938abd694",
            "cidr": "10.0.64.0/19",
            "availabilityZone": "us-east-1c",
            "routeTableId": "rtb-0ecad04cad49bd826"
          }
        ]
      },
      {
        "name": "Private",
        "type": "Private",
        "subnets": [
          {
            "subnetId": "subnet-0085d228d3e18249e",
            "cidr": "10.0.96.0/19",
            "availabilityZone": "us-east-1a",
            "routeTableId": "rtb-0e68dc83a7eaee52b"
          },
          {
            "subnetId": "subnet-0c1f57177b5f27e76",
            "cidr": "10.0.128.0/19",
            "availabilityZone": "us-east-1b",
            "routeTableId": "rtb-08af3c4138d1a26ca"
          },
          {
            "subnetId": "subnet-07492c442575dbd2c",
            "cidr": "10.0.160.0/19",
            "availabilityZone": "us-east-1c",
            "routeTableId": "rtb-0743875d0f322eab2"
          }
        ]
      }
    ]
  },
  "vpc-provider:account=<account_number>:filter.vpc-id=vpc-05c9125968a03fe97:region=us-east-1:returnAsymmetricSubnets=true": {
    "vpcId": "vpc-05c9125968a03fe97",
    "vpcCidrBlock": "10.0.0.0/16",
    "availabilityZones": [],
    "subnetGroups": [
      {
        "name": "Public",
        "type": "Public",
        "subnets": [
          {
            "subnetId": "subnet-0ae7ba04619dfc7af",
            "cidr": "10.0.0.0/19",
            "availabilityZone": "us-east-1a",
            "routeTableId": "rtb-04b0440e27503b7c2"
          },
          {
            "subnetId": "subnet-070b8abc78ee45cc4",
            "cidr": "10.0.32.0/19",
            "availabilityZone": "us-east-1b",
            "routeTableId": "rtb-03f934535932dccf3"
          },
          {
            "subnetId": "subnet-0dabcba1c8fee9aee",
            "cidr": "10.0.64.0/19",
            "availabilityZone": "us-east-1c",
            "routeTableId": "rtb-0f6f68b9a7bbd1df1"
          }
        ]
      },
      {
        "name": "Private",
        "type": "Private",
        "subnets": [
          {
            "subnetId": "subnet-0b12f11b33aa588f0",
            "cidr": "10.0.96.0/19",
            "availabilityZone": "us-east-1a",
            "routeTableId": "rtb-0c8fd18577d1db091"
          },
          {
            "subnetId": "subnet-0c26ce5ac93015603",
            "cidr": "10.0.128.0/19",
            "availabilityZone": "us-east-1b",
            "routeTableId": "rtb-033f5989cd6fec4db"
          },
          {
            "subnetId": "subnet-04f624dc04d0b23ba",
            "cidr": "10.0.160.0/19",
            "availabilityZone": "us-east-1c",
            "routeTableId": "rtb-020d6b2c9c6ce540d"
          }
        ]
      }
    ]
  },
  "ami:account=<account_number>:filters.image-type.0=machine:filters.name.0=amzn-ami-vpc-nat-*:filters.state.0=available:owners.0=amazon:region=us-east-1": "ami-04027ecc3f40c1801"
}
[17:00:30] merged settings: {
  versionReporting: true,
  assetMetadata: true,
  pathMetadata: true,
  output: 'cdk.out',
  app: 'cdk.out',
  build: 'yarn compile',
  progress: 'events',
  context: {},
  debug: false,
  toolkitBucket: {},
  staging: true,
  bundlingStacks: [ 'backend-cd' ],
  lookups: true
}
[17:00:30] [trace] SdkProvider#withAwsCliCompatibleDefaults()
[17:00:30] Determining if we're on an EC2 instance.
[17:00:30] Does not look like an EC2 instance.
[17:00:30] Toolkit stack: CDKToolkit
[17:00:30] Setting "CDK_DEFAULT_REGION" environment variable to us-east-1
[17:00:30] [trace] SdkProvider#defaultAccount()
[17:00:30] [trace]   SdkProvider#defaultCredentials()
[17:00:30] Resolving default credentials
[17:00:30] [trace]   SDK#currentAccount()
[17:00:30] [trace]     SDK#forceCredentialRetrieval()
[17:00:30] Reading cached notices from /home/toha/.cdk/cache/notices.json
[17:00:30] Retrieved account ID <account_number> from disk cache
[17:00:30] Setting "CDK_DEFAULT_ACCOUNT" environment variable to <account_number>
[17:00:30] context: {
  'availability-zones:account=<account_number>:region=us-east-1': [
    'us-east-1a',
    'us-east-1b',
    'us-east-1c',
    'us-east-1d',
    'us-east-1e',
    'us-east-1f'
  ],
  'vpc-provider:account=<account_number>:filter.vpc-id=vpc-00fe623bb1cb307af:region=us-east-1:returnAsymmetricSubnets=true': {
    vpcId: 'vpc-00fe623bb1cb307af',
    vpcCidrBlock: '10.0.0.0/16',
    availabilityZones: [],
    subnetGroups: [ [Object], [Object] ]
  },
  'vpc-provider:account=<account_number>:filter.vpc-id=vpc-05c9125968a03fe97:region=us-east-1:returnAsymmetricSubnets=true': {
    vpcId: 'vpc-05c9125968a03fe97',
    vpcCidrBlock: '10.0.0.0/16',
    availabilityZones: [],
    subnetGroups: [ [Object], [Object] ]
  },
  'ami:account=<account_number>:filters.image-type.0=machine:filters.name.0=amzn-ami-vpc-nat-*:filters.state.0=available:owners.0=amazon:region=us-east-1': 'ami-04027ecc3f40c1801',
  'aws:cdk:enable-path-metadata': true,
  'aws:cdk:enable-asset-metadata': true,
  'aws:cdk:version-reporting': true,
  'aws:cdk:bundling-stacks': [ 'backend-cd' ]
}
yarn run v1.22.22
$ tsc -b
Done in 0.50s.
[17:00:31] --app points to a cloud assembly, so we bypass synth
[17:00:31] Reading cached notices from /home/toha/.cdk/cache/notices.json

Cannot convert undefined or null to object
[17:00:31] TypeError: Cannot convert undefined or null to object
    at Function.keys (<anonymous>)
    at calculateTemplateDiff (/home/toha/.nvm/versions/node/v18.19.1/lib/node_modules/aws-cdk/lib/index.js:394:52274)
    at diffTemplate (/home/toha/.nvm/versions/node/v18.19.1/lib/node_modules/aws-cdk/lib/index.js:394:50944)
    at Object.fullDiff (/home/toha/.nvm/versions/node/v18.19.1/lib/node_modules/aws-cdk/lib/index.js:394:50728)
    at printStackDiff (/home/toha/.nvm/versions/node/v18.19.1/lib/node_modules/aws-cdk/lib/index.js:433:166276)
    at CdkToolkit.diff (/home/toha/.nvm/versions/node/v18.19.1/lib/node_modules/aws-cdk/lib/index.js:433:193682)
    at async exec4 (/home/toha/.nvm/versions/node/v18.19.1/lib/node_modules/aws-cdk/lib/index.js:488:54378)

Notice if --template flag is removed, it works fine:

cdk diff --exclusively --color -vvv -a cdk.out --no-change-set backend-cd
[17:16:06] CDK toolkit version: 2.133.0 (build dcc1e75)
[17:16:06] Command line arguments: {
  _: [ 'diff' ],
  exclusively: true,
  e: true,
  color: true,
  v: 3,
  verbose: 3,
  a: 'cdk.out',
  app: 'cdk.out',
  'change-set': false,
  changeSet: false,
  lookups: true,
  'ignore-errors': false,
  ignoreErrors: false,
  json: false,
  j: false,
  debug: false,
  ec2creds: undefined,
  i: undefined,
  'version-reporting': undefined,
  versionReporting: undefined,
  'path-metadata': undefined,
  pathMetadata: undefined,
  'asset-metadata': undefined,
  assetMetadata: undefined,
  'role-arn': undefined,
  r: undefined,
  roleArn: undefined,
  staging: true,
  'no-color': false,
  noColor: false,
  ci: false,
  'context-lines': 3,
  contextLines: 3,
  strict: false,
  'security-only': false,
  securityOnly: false,
  processed: false,
  quiet: false,
  q: false,
  '$0': 'cdk',
  STACKS: [ 'backend-cd' ],
  'S-t-a-c-k-s': [ 'backend-cd' ]
}
[17:16:06] cdk.json: {
  "app": "node --unhandled-rejections=strict dist/aws/deployment-app.js",
  "build": "yarn compile",
  "progress": "events"
}
[17:16:06] cdk.context.json: {
  "availability-zones:account=<account_number>:region=us-east-1": [
    "us-east-1a",
    "us-east-1b",
    "us-east-1c",
    "us-east-1d",
    "us-east-1e",
    "us-east-1f"
  ],
  "vpc-provider:account=<account_number>:filter.vpc-id=vpc-00fe623bb1cb307af:region=us-east-1:returnAsymmetricSubnets=true": {
    "vpcId": "vpc-00fe623bb1cb307af",
    "vpcCidrBlock": "10.0.0.0/16",
    "availabilityZones": [],
    "subnetGroups": [
      {
        "name": "Public",
        "type": "Public",
        "subnets": [
          {
            "subnetId": "subnet-0dcd6214a092e97bb",
            "cidr": "10.0.0.0/19",
            "availabilityZone": "us-east-1a",
            "routeTableId": "rtb-049bcd6081554adba"
          },
          {
            "subnetId": "subnet-0439f6c9f8173550d",
            "cidr": "10.0.32.0/19",
            "availabilityZone": "us-east-1b",
            "routeTableId": "rtb-001a243184f9a0bf6"
          },
          {
            "subnetId": "subnet-0c08d9ed938abd694",
            "cidr": "10.0.64.0/19",
            "availabilityZone": "us-east-1c",
            "routeTableId": "rtb-0ecad04cad49bd826"
          }
        ]
      },
      {
        "name": "Private",
        "type": "Private",
        "subnets": [
          {
            "subnetId": "subnet-0085d228d3e18249e",
            "cidr": "10.0.96.0/19",
            "availabilityZone": "us-east-1a",
            "routeTableId": "rtb-0e68dc83a7eaee52b"
          },
          {
            "subnetId": "subnet-0c1f57177b5f27e76",
            "cidr": "10.0.128.0/19",
            "availabilityZone": "us-east-1b",
            "routeTableId": "rtb-08af3c4138d1a26ca"
          },
          {
            "subnetId": "subnet-07492c442575dbd2c",
            "cidr": "10.0.160.0/19",
            "availabilityZone": "us-east-1c",
            "routeTableId": "rtb-0743875d0f322eab2"
          }
        ]
      }
    ]
  },
  "vpc-provider:account=<account_number>:filter.vpc-id=vpc-05c9125968a03fe97:region=us-east-1:returnAsymmetricSubnets=true": {
    "vpcId": "vpc-05c9125968a03fe97",
    "vpcCidrBlock": "10.0.0.0/16",
    "availabilityZones": [],
    "subnetGroups": [
      {
        "name": "Public",
        "type": "Public",
        "subnets": [
          {
            "subnetId": "subnet-0ae7ba04619dfc7af",
            "cidr": "10.0.0.0/19",
            "availabilityZone": "us-east-1a",
            "routeTableId": "rtb-04b0440e27503b7c2"
          },
          {
            "subnetId": "subnet-070b8abc78ee45cc4",
            "cidr": "10.0.32.0/19",
            "availabilityZone": "us-east-1b",
            "routeTableId": "rtb-03f934535932dccf3"
          },
          {
            "subnetId": "subnet-0dabcba1c8fee9aee",
            "cidr": "10.0.64.0/19",
            "availabilityZone": "us-east-1c",
            "routeTableId": "rtb-0f6f68b9a7bbd1df1"
          }
        ]
      },
      {
        "name": "Private",
        "type": "Private",
        "subnets": [
          {
            "subnetId": "subnet-0b12f11b33aa588f0",
            "cidr": "10.0.96.0/19",
            "availabilityZone": "us-east-1a",
            "routeTableId": "rtb-0c8fd18577d1db091"
          },
          {
            "subnetId": "subnet-0c26ce5ac93015603",
            "cidr": "10.0.128.0/19",
            "availabilityZone": "us-east-1b",
            "routeTableId": "rtb-033f5989cd6fec4db"
          },
          {
            "subnetId": "subnet-04f624dc04d0b23ba",
            "cidr": "10.0.160.0/19",
            "availabilityZone": "us-east-1c",
            "routeTableId": "rtb-020d6b2c9c6ce540d"
          }
        ]
      }
    ]
  },
  "ami:account=<account_number>:filters.image-type.0=machine:filters.name.0=amzn-ami-vpc-nat-*:filters.state.0=available:owners.0=amazon:region=us-east-1": "ami-04027ecc3f40c1801"
}
[17:16:06] merged settings: {
  versionReporting: true,
  assetMetadata: true,
  pathMetadata: true,
  output: 'cdk.out',
  app: 'cdk.out',
  build: 'yarn compile',
  progress: 'events',
  context: {},
  debug: false,
  toolkitBucket: {},
  staging: true,
  bundlingStacks: [ 'backend-cd' ],
  lookups: true
}
[17:16:06] [trace] SdkProvider#withAwsCliCompatibleDefaults()
[17:16:06] Determining if we're on an EC2 instance.
[17:16:06] Does not look like an EC2 instance.
[17:16:06] Toolkit stack: CDKToolkit
[17:16:06] Setting "CDK_DEFAULT_REGION" environment variable to us-east-1
[17:16:06] [trace] SdkProvider#defaultAccount()
[17:16:06] [trace]   SdkProvider#defaultCredentials()
[17:16:06] Resolving default credentials
[17:16:06] [trace]   SDK#currentAccount()
[17:16:06] [trace]     SDK#forceCredentialRetrieval()
[17:16:06] Reading cached notices from /home/toha/.cdk/cache/notices.json
[17:16:06] Retrieved account ID <account_number> from disk cache
[17:16:06] Setting "CDK_DEFAULT_ACCOUNT" environment variable to <account_number>
[17:16:06] context: {
  'availability-zones:account=<account_number>:region=us-east-1': [
    'us-east-1a',
    'us-east-1b',
    'us-east-1c',
    'us-east-1d',
    'us-east-1e',
    'us-east-1f'
  ],
  'vpc-provider:account=<account_number>:filter.vpc-id=vpc-00fe623bb1cb307af:region=us-east-1:returnAsymmetricSubnets=true': {
    vpcId: 'vpc-00fe623bb1cb307af',
    vpcCidrBlock: '10.0.0.0/16',
    availabilityZones: [],
    subnetGroups: [ [Object], [Object] ]
  },
  'vpc-provider:account=<account_number>:filter.vpc-id=vpc-05c9125968a03fe97:region=us-east-1:returnAsymmetricSubnets=true': {
    vpcId: 'vpc-05c9125968a03fe97',
    vpcCidrBlock: '10.0.0.0/16',
    availabilityZones: [],
    subnetGroups: [ [Object], [Object] ]
  },
  'ami:account=<account_number>:filters.image-type.0=machine:filters.name.0=amzn-ami-vpc-nat-*:filters.state.0=available:owners.0=amazon:region=us-east-1': 'ami-04027ecc3f40c1801',
  'aws:cdk:enable-path-metadata': true,
  'aws:cdk:enable-asset-metadata': true,
  'aws:cdk:version-reporting': true,
  'aws:cdk:bundling-stacks': [ 'backend-cd' ]
}
yarn run v1.22.22
$ tsc -b
Done in 0.54s.
[17:16:07] --app points to a cloud assembly, so we bypass synth
Stack backend-cd
[17:16:07] [trace] SdkProvider#resolveEnvironment()
[17:16:07] [trace]   SdkProvider#defaultAccount()
[17:16:07] [trace] SdkProvider#baseCredentialsPartition()
[17:16:07] [trace]   SdkProvider#resolveEnvironment()
[17:16:07] [trace]   SdkProvider#obtainBaseCredentials()
[17:16:07] [trace]     SdkProvider#defaultAccount()
[17:16:07] [trace]     SdkProvider#defaultCredentials()
[17:16:07] [trace]   SDK#currentAccount()
[17:16:07] [trace]     SDK#forceCredentialRetrieval()
[17:16:07] Retrieved account ID <account_number> from disk cache
[17:16:07] [trace] SdkProvider#forEnvironment()
[17:16:07] [trace]   SdkProvider#resolveEnvironment()
[17:16:07] [trace]   SdkProvider#obtainBaseCredentials()
[17:16:07] [trace]     SdkProvider#defaultAccount()
[17:16:07] [trace]     SdkProvider#defaultCredentials()
[17:16:07] [trace]   SdkProvider#withAssumedRole()
[17:16:07] Assuming role 'arn:aws:iam::<account_number>:role/cdk-hnb659fds-lookup-role-<account_number>-us-east-1'.
[17:16:07] [trace]   SDK#forceCredentialRetrieval()
[17:16:08] [trace] SDK#ssm()
[17:16:08] [trace]   SDK#wrapServiceErrorHandling()
[17:16:08] [AWS ssm 200 0.708s 0 retries] getParameter({ Name: '/cdk-bootstrap/hnb659fds/version' })
[17:16:08] [trace] SDK#cloudFormation()
[17:16:08] [trace]   SDK#wrapServiceErrorHandling()
[17:16:09] [AWS cloudformation 200 0.548s 0 retries] describeStacks({ StackName: 'backend-cd' })
[17:16:10] [AWS cloudformation 200 1.063s 0 retries] getTemplate({ StackName: 'backend-cd', TemplateStage: 'Original' })
[17:16:10] [trace] SdkProvider#resolveEnvironment()
[17:16:10] [trace]   SdkProvider#defaultAccount()
Resources
[~] AWS::Logs::LogGroup CodeBuildResultsLogGroup CodeBuildResultsLogGroup535329BA replace
 └─ [~] LogGroupName (requires replacement)
     ├─ [-] /aws/codebuild/202403261110
     └─ [+] /aws/codebuild/202404181358

✨  Number of stacks with differences: 1
[17:16:10] Reading cached notices from /home/toha/.cdk/cache/notices.json

Reproduction Steps

Cannot convert undefined or null to object [17:00:31] TypeError: Cannot convert undefined or null to object at Function.keys () at calculateTemplateDiff (/home/toha/.nvm/versions/node/v18.19.1/lib/node_modules/aws-cdk/lib/index.js:394:52274) at diffTemplate (/home/toha/.nvm/versions/node/v18.19.1/lib/node_modules/aws-cdk/lib/index.js:394:50944) at Object.fullDiff (/home/toha/.nvm/versions/node/v18.19.1/lib/node_modules/aws-cdk/lib/index.js:394:50728) at printStackDiff (/home/toha/.nvm/versions/node/v18.19.1/lib/node_modules/aws-cdk/lib/index.js:433:166276) at CdkToolkit.diff (/home/toha/.nvm/versions/node/v18.19.1/lib/node_modules/aws-cdk/lib/index.js:433:193682) at async exec4 (/home/toha/.nvm/versions/node/v18.19.1/lib/node_modules/aws-cdk/lib/index.js:488:54378)


### Possible Solution

_No response_

### Additional Information/Context

Logs of a working run with `v2.132.0`:

cdk diff --exclusively --color -vvv --template tmp/backend-cd.template.json -a cdk.out --no-change-set backend-cd [16:51:09] CDK toolkit version: 2.132.0 (build 9a51c89) [16:51:09] Command line arguments: { _: [ 'diff' ], exclusively: true, e: true, color: true, v: 3, verbose: 3, template: 'tmp/backend-cd.template.json', a: 'cdk.out', app: 'cdk.out', 'change-set': false, changeSet: false, lookups: true, 'ignore-errors': false, ignoreErrors: false, json: false, j: false, debug: false, ec2creds: undefined, i: undefined, 'version-reporting': undefined, versionReporting: undefined, 'path-metadata': undefined, pathMetadata: undefined, 'asset-metadata': undefined, assetMetadata: undefined, 'role-arn': undefined, r: undefined, roleArn: undefined, staging: true, 'no-color': false, noColor: false, ci: false, 'context-lines': 3, contextLines: 3, strict: false, 'security-only': false, securityOnly: false, processed: false, quiet: false, q: false, '$0': 'cdk', STACKS: [ 'backend-cd' ], 'S-t-a-c-k-s': [ 'backend-cd' ] } [16:51:09] cdk.json: { "app": "node --unhandled-rejections=strict dist/aws/deployment-app.js", "build": "yarn compile", "progress": "events" } [16:51:09] cdk.context.json: { "availability-zones:account=:region=us-east-1": [ "us-east-1a", "us-east-1b", "us-east-1c", "us-east-1d", "us-east-1e", "us-east-1f" ], "vpc-provider:account=:filter.vpc-id=vpc-00fe623bb1cb307af:region=us-east-1:returnAsymmetricSubnets=true": { "vpcId": "vpc-00fe623bb1cb307af", "vpcCidrBlock": "10.0.0.0/16", "availabilityZones": [], "subnetGroups": [ { "name": "Public", "type": "Public", "subnets": [ { "subnetId": "subnet-0dcd6214a092e97bb", "cidr": "10.0.0.0/19", "availabilityZone": "us-east-1a", "routeTableId": "rtb-049bcd6081554adba" }, { "subnetId": "subnet-0439f6c9f8173550d", "cidr": "10.0.32.0/19", "availabilityZone": "us-east-1b", "routeTableId": "rtb-001a243184f9a0bf6" }, { "subnetId": "subnet-0c08d9ed938abd694", "cidr": "10.0.64.0/19", "availabilityZone": "us-east-1c", "routeTableId": "rtb-0ecad04cad49bd826" } ] }, { "name": "Private", "type": "Private", "subnets": [ { "subnetId": "subnet-0085d228d3e18249e", "cidr": "10.0.96.0/19", "availabilityZone": "us-east-1a", "routeTableId": "rtb-0e68dc83a7eaee52b" }, { "subnetId": "subnet-0c1f57177b5f27e76", "cidr": "10.0.128.0/19", "availabilityZone": "us-east-1b", "routeTableId": "rtb-08af3c4138d1a26ca" }, { "subnetId": "subnet-07492c442575dbd2c", "cidr": "10.0.160.0/19", "availabilityZone": "us-east-1c", "routeTableId": "rtb-0743875d0f322eab2" } ] } ] }, "vpc-provider:account=:filter.vpc-id=vpc-05c9125968a03fe97:region=us-east-1:returnAsymmetricSubnets=true": { "vpcId": "vpc-05c9125968a03fe97", "vpcCidrBlock": "10.0.0.0/16", "availabilityZones": [], "subnetGroups": [ { "name": "Public", "type": "Public", "subnets": [ { "subnetId": "subnet-0ae7ba04619dfc7af", "cidr": "10.0.0.0/19", "availabilityZone": "us-east-1a", "routeTableId": "rtb-04b0440e27503b7c2" }, { "subnetId": "subnet-070b8abc78ee45cc4", "cidr": "10.0.32.0/19", "availabilityZone": "us-east-1b", "routeTableId": "rtb-03f934535932dccf3" }, { "subnetId": "subnet-0dabcba1c8fee9aee", "cidr": "10.0.64.0/19", "availabilityZone": "us-east-1c", "routeTableId": "rtb-0f6f68b9a7bbd1df1" } ] }, { "name": "Private", "type": "Private", "subnets": [ { "subnetId": "subnet-0b12f11b33aa588f0", "cidr": "10.0.96.0/19", "availabilityZone": "us-east-1a", "routeTableId": "rtb-0c8fd18577d1db091" }, { "subnetId": "subnet-0c26ce5ac93015603", "cidr": "10.0.128.0/19", "availabilityZone": "us-east-1b", "routeTableId": "rtb-033f5989cd6fec4db" }, { "subnetId": "subnet-04f624dc04d0b23ba", "cidr": "10.0.160.0/19", "availabilityZone": "us-east-1c", "routeTableId": "rtb-020d6b2c9c6ce540d" } ] } ] }, "ami:account=:filters.image-type.0=machine:filters.name.0=amzn-ami-vpc-nat-:filters.state.0=available:owners.0=amazon:region=us-east-1": "ami-04027ecc3f40c1801" } [16:51:09] merged settings: { versionReporting: true, assetMetadata: true, pathMetadata: true, output: 'cdk.out', app: 'cdk.out', build: 'yarn compile', progress: 'events', context: {}, debug: false, toolkitBucket: {}, staging: true, bundlingStacks: [ 'backend-cd' ], lookups: true } [16:51:09] [trace] SdkProvider#withAwsCliCompatibleDefaults() [16:51:09] Determining if we're on an EC2 instance. [16:51:09] Does not look like an EC2 instance. [16:51:09] Toolkit stack: CDKToolkit [16:51:09] Setting "CDK_DEFAULT_REGION" environment variable to us-east-1 [16:51:09] [trace] SdkProvider#defaultAccount() [16:51:09] [trace] SdkProvider#defaultCredentials() [16:51:09] Resolving default credentials [16:51:09] [trace] SDK#currentAccount() [16:51:09] [trace] SDK#forceCredentialRetrieval() [16:51:09] Reading cached notices from /home/toha/.cdk/cache/notices.json [16:51:09] Retrieved account ID from disk cache [16:51:09] Setting "CDK_DEFAULT_ACCOUNT" environment variable to [16:51:09] context: { 'availability-zones:account=:region=us-east-1': [ 'us-east-1a', 'us-east-1b', 'us-east-1c', 'us-east-1d', 'us-east-1e', 'us-east-1f' ], 'vpc-provider:account=:filter.vpc-id=vpc-00fe623bb1cb307af:region=us-east-1:returnAsymmetricSubnets=true': { vpcId: 'vpc-00fe623bb1cb307af', vpcCidrBlock: '10.0.0.0/16', availabilityZones: [], subnetGroups: [ [Object], [Object] ] }, 'vpc-provider:account=:filter.vpc-id=vpc-05c9125968a03fe97:region=us-east-1:returnAsymmetricSubnets=true': { vpcId: 'vpc-05c9125968a03fe97', vpcCidrBlock: '10.0.0.0/16', availabilityZones: [], subnetGroups: [ [Object], [Object] ] }, 'ami:account=:filters.image-type.0=machine:filters.name.0=amzn-ami-vpc-nat-:filters.state.0=available:owners.0=amazon:region=us-east-1': 'ami-04027ecc3f40c1801', 'aws:cdk:enable-path-metadata': true, 'aws:cdk:enable-asset-metadata': true, 'aws:cdk:version-reporting': true, 'aws:cdk:bundling-stacks': [ 'backend-cd' ] } yarn run v1.22.22 $ tsc -b Done in 0.51s. [16:51:10] --app points to a cloud assembly, so we bypass synth [16:51:10] [trace] SdkProvider#resolveEnvironment() [16:51:10] [trace] SdkProvider#defaultAccount() [16:51:10] [trace] SdkProvider#baseCredentialsPartition() [16:51:10] [trace] SdkProvider#resolveEnvironment() [16:51:10] [trace] SdkProvider#obtainBaseCredentials() [16:51:10] [trace] SdkProvider#defaultAccount() [16:51:10] [trace] SdkProvider#defaultCredentials() [16:51:10] [trace] SDK#currentAccount() [16:51:10] [trace] SDK#forceCredentialRetrieval() [16:51:10] Retrieved account ID from disk cache [16:51:10] [trace] SdkProvider#forEnvironment() [16:51:10] [trace] SdkProvider#resolveEnvironment() [16:51:10] [trace] SdkProvider#obtainBaseCredentials() [16:51:10] [trace] SdkProvider#defaultAccount() [16:51:10] [trace] SdkProvider#defaultCredentials() [16:51:10] [trace] SdkProvider#withAssumedRole() [16:51:10] Assuming role 'arn:aws:iam:::role/cdk-hnb659fds-deploy-role--us-east-1'. [16:51:10] [trace] SDK#forceCredentialRetrieval() [16:51:11] [trace] SDK#cloudFormation() [16:51:11] [trace] SDK#wrapServiceErrorHandling() [16:51:11] [AWS cloudformation 200 0.722s 0 retries] describeStacks({ StackName: 'backend-cd' }) Resources [~] AWS::Logs::LogGroup CodeBuildResultsLogGroup CodeBuildResultsLogGroup535329BA replace └─ [~] LogGroupName (requires replacement) ├─ [-] /aws/codebuild/202403261110 └─ [+] /aws/codebuild/202404181350

✨ Number of stacks with differences: 1 [16:51:12] Reading cached notices from /home/toha/.cdk/cache/notices.json

NOTICES (What's this? https://github.com/aws/aws-cdk/wiki/CLI-Notices)

29420 (cli): List stack output change issue.

Overview: v2.132.0 introduced functionality to the cdk list command to
          display stack dependencies. This feature introduced a change
          that displays stack ids over displayName altering the
          existing list functionality

Affected versions: cli: 2.132.0

More information at: https://github.com/aws/aws-cdk/issues/29420

29483 (cli): Upgrading to v2.132.0 or v2.132.1 breaks cdk diff functionality

Overview: cdk diff functionality used to rely on assuming lookup-role.
          With a recent change present in v2.132.0 and v2.132.1, it is
          now trying to assume deploy-role with the lookup-role. This
          leads to an authorization error if permissions were not
          defined to assume deploy-role.

Affected versions: cli: >=2.132.0 <=2.132.1

More information at: https://github.com/aws/aws-cdk/issues/29483


### CDK CLI Version

2.133.0 (build dcc1e75)

### Framework Version

_No response_

### Node.js Version

v18.19.1

### OS

Ubuntu 22.04.4 LTS

### Language

TypeScript

### Language Version

4.7.3

### Other information

Looking at commits between 2.132.0 and 2.133.0 there were at least two PRs merged related to diffing but Im not competent on CDK to understand if they could be related: https://github.com/aws/aws-cdk/commits/main/?since=2024-03-09&until=2024-03-15
github-actions[bot] commented 6 months ago

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

aws-cdk-automation commented 3 months ago

Comments on closed issues and PRs are hard for our team to see. If you need help, please open a new issue that references this one.