Aws-cdk: CDK Bootstrap - Cannot read property 'split' of undefined

Created on 15 Oct 2019  路  1Comment  路  Source: aws/aws-cdk

When running cdk bootstrap the application fails early with Cannot read property 'split' of undefined. This used to work in version 1.12.0

Reproduction Steps

npm install -g [email protected]
cdk init sample-app --language=typescript
cdk bootstrap "aws://{{AWS_ACCOUNT_ID}}/eu-west-2"

Error Log

CDK toolkit version: 1.13.0 (build 250a270)
Command line arguments: { _: [ 'bootstrap' ],
  verbose: true,
  v: true,
  'ignore-errors': false,
  ignoreErrors: false,
  json: false,
  j: false,
  ec2creds: undefined,
  i: undefined,
  'version-reporting': undefined,
  versionReporting: undefined,
  'path-metadata': true,
  pathMetadata: true,
  'asset-metadata': true,
  assetMetadata: true,
  'role-arn': undefined,
  r: undefined,
  roleArn: undefined,
  staging: true,
  'no-color': false,
  noColor: false,
  'bootstrap-bucket-name': undefined,
  b: undefined,
  'toolkit-bucket-name': undefined,
  toolkitBucketName: undefined,
  bootstrapBucketName: undefined,
  'bootstrap-kms-key-id': undefined,
  bootstrapKmsKeyId: undefined,
  tags: [ undefined ],
  t: [ undefined ],
  '$0': 'cdk',
  ENVIRONMENTS: [ 'aws://--AWS_ACCOUNT_ID--/eu-west-2' ],
  environments: [ 'aws://--AWS_ACCOUNT_ID--/eu-west-2' ] }
Determining whether we're on an EC2 instance.
Cannot read property 'split' of undefined
TypeError: Cannot read property 'split' of undefined
    at Function.parseStringTagsListToObject (/Users/j.liddiard/.nvm/versions/node/v10.16.0/lib/node_modules/aws-cdk/lib/settings.ts:255:32)
    at Function.fromCommandLineArguments (/Users/j.liddiard/.nvm/versions/node/v10.16.0/lib/node_modules/aws-cdk/lib/settings.ts:202:23)
    at new Configuration (/Users/j.liddiard/.nvm/versions/node/v10.16.0/lib/node_modules/aws-cdk/lib/settings.ts:44:42)
    at initCommandLine (/Users/j.liddiard/.nvm/versions/node/v10.16.0/lib/node_modules/aws-cdk/bin/cdk.ts:103:25)

Environment

  • CLI Version :1.13.0
  • Framework Version:**
  • OS :OSX
  • Language :Typescript (also Scala)

This is :bug: Bug Report

bug packagtools

Most helpful comment

Thanks for reporting this bug! Seems like it was introduced by an incorrect characterization of the default value for tags as undefined.

Adding a tag will get you around it, looking into creating a PR for fixing it.

workaround for now: cdk bootstrap "aws://{{AWS_ACCOUNT_ID}}/eu-west-2" --tags type=cdk-bootstrap or any key/value as tags

>All comments

Thanks for reporting this bug! Seems like it was introduced by an incorrect characterization of the default value for tags as undefined.

Adding a tag will get you around it, looking into creating a PR for fixing it.

workaround for now: cdk bootstrap "aws://{{AWS_ACCOUNT_ID}}/eu-west-2" --tags type=cdk-bootstrap or any key/value as tags

Was this page helpful?
0 / 5 - 0 ratings