Skip to content

AwsCdkCli: Unable to provide Environment to Bootstrap command #31656

@ghost

Description

Describe the bug

I am attempting to run the bootstrap command from a lambda.

const cli = AwsCdkCli.fromCdkAppDirectory();
await cli.bootstrap();

This gives the error Error: Specify an environment name like 'aws://123456789012/us-east-1'.
When running cdk bootstrap from the terminal, I would provide this value. But I don't see anywhere in BootstrapOptions to provide this.

Regression Issue

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

Last Known Working CDK Version

No response

Expected Behavior

I would expect to have somewhere here I would provide the environment information.

Current Behavior

Currently I get this error message Error: Specify an environment name like 'aws://123456789012/us-east-1'.

Reproduction Steps

Run code similar to the following in a lambda.

const cli = AwsCdkCli.fromCdkAppDirectory();
await cli.bootstrap();

Possible Solution

Add a field in BootstrapOptions to accept the environment information like "aws://123456789012/us-east-1".

Additional Information/Context

No response

CDK CLI Version

N/A

Framework Version

No response

Node.js Version

aws_lambda.Runtime.NODEJS_20_X

OS

AWS Lambda

Language

TypeScript

Language Version

No response

Other information

No response

Metadata

Metadata

Assignees

Labels

bugThis issue is a bug.cliIssues related to the CDK CLIeffort/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