question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

CDK Bootstrap requires --app

See original GitHub issue

❓ General Issue

The Question

I recently updated my project aws-cdk dependencies from v1.35.0 to v1.38.0 and I seem to be experiencing a new issue where if I call npx cdk bootstrap aws://${TARGET_ACCOUNT}/${AWS_REGION} in my bash script, I get the error --app is required either in command-line, in cdk.json or in ~/.cdk.json previously I was able to use this command without --app.

I noticed that there was something changed in this area in v1.36.0, see #7510.

I’m struggling to find any supporting documentation on this change where --app is required to run cdk bootstrap.

Is this intended functionality, or has a bug been introduced?

Environment

  • CDK CLI Version: 1.38.0 (build d5fa31f)
  • Module Version: 1.38.0
  • OS: all
  • Language: TypeScript

Other information

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:11 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
shivlakscommented, May 13, 2020

@tmclaugh - thanks! - I think i’ve gotten into the failure point. writing up a fix, tests, etc

0reactions
tmclaughcommented, May 13, 2020

Below is from my CI/CD pipeline logs. I want to add that I don’t bootstrap from an existing product. This is a CI/CD pipeline job to bootstrap a new account.

error	13-May-2020 13:20:55	CDK toolkit version: 1.38.0 (build d5fa31f)
error	13-May-2020 13:20:55	Command line arguments: { _: [ 'bootstrap' ],
error	13-May-2020 13:20:55	  tags: [ 'deployment_guid=dd1844a6-4f1a-459a-acb0-7ed74640e770' ],
error	13-May-2020 13:20:55	  t: [ 'deployment_guid=dd1844a6-4f1a-459a-acb0-7ed74640e770' ],
error	13-May-2020 13:20:55	  v: true,
error	13-May-2020 13:20:55	  verbose: true,
error	13-May-2020 13:20:55	  'ignore-errors': false,
error	13-May-2020 13:20:55	  ignoreErrors: false,
error	13-May-2020 13:20:55	  json: false,
error	13-May-2020 13:20:55	  j: false,
error	13-May-2020 13:20:55	  ec2creds: undefined,
error	13-May-2020 13:20:55	  i: undefined,
error	13-May-2020 13:20:55	  'version-reporting': undefined,
error	13-May-2020 13:20:55	  versionReporting: undefined,
error	13-May-2020 13:20:55	  'path-metadata': true,
error	13-May-2020 13:20:55	  pathMetadata: true,
error	13-May-2020 13:20:55	  'asset-metadata': true,
error	13-May-2020 13:20:55	  assetMetadata: true,
error	13-May-2020 13:20:55	  'role-arn': undefined,
error	13-May-2020 13:20:55	  r: undefined,
error	13-May-2020 13:20:55	  roleArn: undefined,
error	13-May-2020 13:20:55	  staging: true,
error	13-May-2020 13:20:55	  'no-color': false,
error	13-May-2020 13:20:55	  noColor: false,
error	13-May-2020 13:20:55	  fail: false,
error	13-May-2020 13:20:55	  'bootstrap-bucket-name': undefined,
error	13-May-2020 13:20:55	  b: undefined,
error	13-May-2020 13:20:55	  'toolkit-bucket-name': undefined,
error	13-May-2020 13:20:55	  toolkitBucketName: undefined,
error	13-May-2020 13:20:55	  bootstrapBucketName: undefined,
error	13-May-2020 13:20:55	  'bootstrap-kms-key-id': undefined,
error	13-May-2020 13:20:55	  bootstrapKmsKeyId: undefined,
error	13-May-2020 13:20:55	  execute: true,
error	13-May-2020 13:20:55	  trust: [],
error	13-May-2020 13:20:55	  'cloudformation-execution-policies': [],
error	13-May-2020 13:20:55	  cloudformationExecutionPolicies: [],
error	13-May-2020 13:20:55	  force: false,
error	13-May-2020 13:20:55	  f: false,
error	13-May-2020 13:20:55	  '$0': '../../../../.npm/_npx/10149/bin/cdk',
error	13-May-2020 13:20:55	  ENVIRONMENTS: [ 'aws://123456789012/us-east-1' ],
error	13-May-2020 13:20:55	  environments: [ 'aws://123456789012/us-east-1' ] }
error	13-May-2020 13:20:55	CLI argument tags: deployment_guid=dd1844a6-4f1a-459a-acb0-7ed74640e770
error	13-May-2020 13:20:55	merged settings: { versionReporting: true,
error	13-May-2020 13:20:55	  pathMetadata: true,
error	13-May-2020 13:20:55	  output: 'cdk.out',
error	13-May-2020 13:20:55	  context: {},
error	13-May-2020 13:20:55	  tags:
error	13-May-2020 13:20:55	   [ { Key: 'deployment_guid',
error	13-May-2020 13:20:55	       Value: 'dd1844a6-4f1a-459a-acb0-7ed74640e770' } ],
error	13-May-2020 13:20:55	  assetMetadata: true,
error	13-May-2020 13:20:55	  toolkitBucket: {},
error	13-May-2020 13:20:55	  staging: true }
error	13-May-2020 13:20:55	Determining whether we're on an EC2 instance.
error	13-May-2020 13:20:55	Looks like EC2 instance.
error	13-May-2020 13:20:55	Unable to determine AWS region from environment or AWS configuration (profile: "default"), defaulting to 'us-east-1'
error	13-May-2020 13:20:55	Toolkit stack: CDKToolkit
error	13-May-2020 13:20:55	Setting "CDK_DEFAULT_REGION" environment variable to us-east-1
error	13-May-2020 13:20:55	Resolving default credentials
error	13-May-2020 13:20:55	Looking up default account ID from STS
error	13-May-2020 13:20:55	Default account ID: 387223410295
error	13-May-2020 13:20:55	Setting "CDK_DEFAULT_ACCOUNT" environment variable to 387223410295
error	13-May-2020 13:20:55	context: { 'aws:cdk:enable-path-metadata': true,
error	13-May-2020 13:20:55	  'aws:cdk:enable-asset-metadata': true }
error	13-May-2020 13:20:55	--app is required either in command-line, in cdk.json or in ~/.cdk.json
error	13-May-2020 13:20:55	Error: --app is required either in command-line, in cdk.json or in ~/.cdk.json
error	13-May-2020 13:20:55	    at Object.execProgram (/home/bamboo/.npm/_npx/10149/lib/node_modules/cdk/node_modules/aws-cdk/lib/api/cxapp/exec.ts:47:11)
Read more comments on GitHub >

github_iconTop Results From Across the Web

Bootstrapping - AWS Cloud Development Kit (AWS CDK) v2
Bootstrapping is the process of provisioning resources for the AWS CDK before you can ... May require changes to your CDK app (see...
Read more >
What does CDK Bootstrap do | bobbyhadz
CDK bootstrap creates a CloudFormation stack with an S3 bucket that stores file assets, required for deployments.
Read more >
Least deployment privilege with CDK Bootstrap - Better Dev
Bootstrapping creates the resources required by the CDK on the account. ... only the AWS services that we use in our CDK application....
Read more >
Production-Ready CDK - Bootstrapping - Luminis
What is AWS CDK Bootstrapping? To use CDK and deploy our CDK app to our AWS environment(an AWS account plus a region), we...
Read more >
Bootstrapping AWS CDK in a Secure Environment - Medium
You know the name of the permission boundary policy required in your environment. Generate a default CDK bootstrap template and save it as...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found