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

(cli-lib): cannot load the default bootstrap template #26224

Closed
AntonioAngelino opened this issue Jul 4, 2023 · 3 comments · Fixed by #26229
Closed

(cli-lib): cannot load the default bootstrap template #26224

AntonioAngelino opened this issue Jul 4, 2023 · 3 comments · Fixed by #26229
Labels
bug This issue is a bug. needs-triage This issue or PR still needs to be triaged. package/tools Related to AWS CDK Tools or CLI

Comments

@AntonioAngelino
Copy link
Contributor

AntonioAngelino commented Jul 4, 2023

Describe the bug

I discovered a bug in the bootstrap command I implemented yesterday. It doesn't work out of the box because it cannot find the default YAML template.

The cli-lib tries to load the bootstrap-template.yaml in @aws-cdk/cli-lib-alpha/lib/api/bootstrap/bootstrap-template.yaml instead of aws-cdk/lib/api/bootstrap/bootstrap-template.yaml

Expected Behavior

CDK deploys the default bootstrap stack.

Current Behavior

The CLI returns the following error:

Environment aws://XXXXXXX/us-east-1 failed bootstrapping: [Error: ENOENT: no such file or directory, open 'XXXX/node_modules/@aws-cdk/cli-lib-alpha/lib/api/bootstrap/bootstrap-template.yaml'] {
  errno: -2,
  code: 'ENOENT',
  syscall: 'open',
  path: 'XXXX/node_modules/@aws-cdk/cli-lib-alpha/lib/api/bootstrap/bootstrap-template.yaml'
}

Reproduction Steps

Follow the CLI lib documentation to create an instance of the AwsCdkCli and then invoke the cli.bootstrap(); method.

Possible Solution

The following line should be edited:

return loadStructuredFile(path.join(rootDir(), 'lib', 'api', 'bootstrap', 'bootstrap-template.yaml'));

I can open a new PR, but I'm not sure what's the best way of fixing it. Should I change rootDir() with something else?

Additional Information/Context

No response

CDK CLI Version

main branch

Framework Version

No response

Node.js Version

18

OS

node:18-alpine

Language

Typescript

Language Version

No response

Other information

No response

@AntonioAngelino AntonioAngelino added bug This issue is a bug. needs-triage This issue or PR still needs to be triaged. labels Jul 4, 2023
@github-actions github-actions bot added the package/tools Related to AWS CDK Tools or CLI label Jul 4, 2023
@mrgrain
Copy link
Contributor

mrgrain commented Jul 4, 2023

Reproducing this right now.

@mrgrain
Copy link
Contributor

mrgrain commented Jul 4, 2023

Confirmed. This is a bundling issue and we need to copy over bootstrap-template.yaml during bundling.

@mergify mergify bot closed this as completed in #26229 Jul 4, 2023
mergify bot pushed a commit that referenced this issue Jul 4, 2023
Closes #26224

----

*By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
@github-actions
Copy link

github-actions bot commented Jul 4, 2023

⚠️COMMENT VISIBILITY WARNING⚠️

Comments on closed issues are hard for our team to see.
If you need more assistance, please either tag a team member or open a new issue that references this one.
If you wish to keep having a conversation with other community members under this issue feel free to do so.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug This issue is a bug. needs-triage This issue or PR still needs to be triaged. package/tools Related to AWS CDK Tools or CLI
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants