When running cdk bootstrap the application fails early with Cannot read property 'split' of undefined. This used to work in version 1.12.0
npm install -g [email protected]
cdk init sample-app --language=typescript
cdk bootstrap "aws://{{AWS_ACCOUNT_ID}}/eu-west-2"
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)
This is :bug: Bug Report
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
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-bootstrapor any key/value as tags