Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AwsCdkCli: Unable to provide Environment to Bootstrap command #31656

Closed
1 task
joe-eagle-emc opened this issue Oct 4, 2024 · 3 comments · Fixed by #31713
Closed
1 task

AwsCdkCli: Unable to provide Environment to Bootstrap command #31656

joe-eagle-emc opened this issue Oct 4, 2024 · 3 comments · Fixed by #31713
Assignees
Labels
bug This issue is a bug. cli Issues related to the CDK CLI effort/medium Medium work item – several days of effort p2 package/tools Related to AWS CDK Tools or CLI

Comments

@joe-eagle-emc
Copy link

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

@joe-eagle-emc joe-eagle-emc added bug This issue is a bug. needs-triage This issue or PR still needs to be triaged. labels Oct 4, 2024
@github-actions github-actions bot added the package/tools Related to AWS CDK Tools or CLI label Oct 4, 2024
@pahud
Copy link
Contributor

pahud commented Oct 4, 2024

Yes, it's unclear to me how to specify that using AwsCdkCli.

We'll bring it up to the team for inputs.

@pahud pahud added cli Issues related to the CDK CLI p2 effort/medium Medium work item – several days of effort and removed needs-triage This issue or PR still needs to be triaged. labels Oct 4, 2024
@mrgrain
Copy link
Contributor

mrgrain commented Oct 8, 2024

Yes, it's unclear to me how to specify that using AwsCdkCli.

We'll bring it up to the team for inputs.

Correct, this is not currently possible. Thanks for the report.

@mrgrain mrgrain self-assigned this Oct 10, 2024
mergify bot pushed a commit that referenced this issue Oct 10, 2024
### Issue

Closes #31656

### Reason for this change

When boostrapping, users may need to explicitly provide the environment if it can be determined from the app or shell environment. Previously this was not possible using the cli-lib-alpha package.

### Description of changes

Add a new argument to support environments.

### Description of how you validated changes

Unit test case was added.

### Checklist
- [x] My code adheres to the [CONTRIBUTING GUIDE](https://github.com/aws/aws-cdk/blob/main/CONTRIBUTING.md) and [DESIGN GUIDELINES](https://github.com/aws/aws-cdk/blob/main/docs/DESIGN_GUIDELINES.md)

----

*By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
@mergify mergify bot closed this as completed in #31713 Oct 10, 2024
Copy link

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.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Oct 10, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug This issue is a bug. cli Issues related to the CDK CLI effort/medium Medium work item – several days of effort p2 package/tools Related to AWS CDK Tools or CLI
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants