Skip to content
New issue

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

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

Already on GitHub? # to your account

Feat (CLI): Addition of a flag to override the context json file path #30494

Closed
1 of 2 tasks
karmabadger opened this issue Jun 8, 2024 · 7 comments
Closed
1 of 2 tasks
Labels
cli Issues related to the CDK CLI closed-for-staleness This issue was automatically closed because it hadn't received any attention in a while. effort/large Large work item – several weeks of effort feature-request A feature should be added or improved. p2 response-requested Waiting on additional info and feedback. Will move to "closing-soon" in 7 days.

Comments

@karmabadger
Copy link

Describe the feature

Feat (CLI): Addition of a flag to override the context json file path.

Often times, you may have different environments and deployment strategies. Being able to switch the cdk.json context file easily helps keeping commands constant but easily switch the context which is used to run them.

For instance package.json can have a script deploy which uses cdk.json and then a deploy:dev which reads cdk.dev.json.

Use Case

I'm always frustrated when I want a quick dev stack for development purposes but my prod stack has to compile all the TS files into JS, run tests, and then deploy whereas the dev stack should just quickly transpile into JS using something like SWC for quicker iteration. But since I need to make sure my prod environment run correctly from the built JS files instead of SWC, I have to keep everything consistent to the slower path.

Proposed Solution

adding the flag --context-json (or any other alternative to this if this is too confusing compared to the other context flag) to override the default cdk.json file.

Other Information

No response

Acknowledgements

  • I may be able to implement this feature request
  • This feature might incur a breaking change

CDK version used

2.144.0 (build 5fb15bc)

Environment details (OS name and version, etc.)

MacOS Sonoma 14.5

@karmabadger karmabadger added feature-request A feature should be added or improved. needs-triage This issue or PR still needs to be triaged. labels Jun 8, 2024
@github-actions github-actions bot added the package/tools Related to AWS CDK Tools or CLI label Jun 8, 2024
@khushail khushail added investigating This issue is being investigated and/or work is in progress to resolve the issue. and removed needs-triage This issue or PR still needs to be triaged. labels Jun 10, 2024
@khushail khushail self-assigned this Jun 10, 2024
@khushail
Copy link
Contributor

Hi @karmabadger , thanks for reaching out. I see your usecase could be worked upon by the solution suggested here -
#23911 (comment)

However we have this open issue and few similar requests in the past as well -
Currently opened issue - #23911 (quite similar to your request)
Past issue - #14948

Please confirm if you feel the issue is similar to open issue and I could mark it appropriately for further assistance.

@khushail khushail added p1 effort/large Large work item – several weeks of effort cli Issues related to the CDK CLI response-requested Waiting on additional info and feedback. Will move to "closing-soon" in 7 days. and removed investigating This issue is being investigated and/or work is in progress to resolve the issue. package/tools Related to AWS CDK Tools or CLI labels Jun 10, 2024
@karmabadger
Copy link
Author

it is similar, but also those are long due
@khushail.
I really need isolated prod vs dev.

@virajkanwade
Copy link

@khushail I had also submitted a PR implementing the feature.
#23912

But since I am no TypeScript expert, I could not figure out the tests. So it was not merged.

For a feature that was requested exactly 3 years ago, with a potential solution shared 1.5 years ago, it is still open because nobody wants to take up updating the unit tests.

@github-actions github-actions bot removed the response-requested Waiting on additional info and feedback. Will move to "closing-soon" in 7 days. label Jun 11, 2024
@khushail khushail added the needs-discussion This issue/PR requires more discussion with community. label Jun 11, 2024
@khushail
Copy link
Contributor

khushail commented Jun 11, 2024

@karmabadger , thanks for the response. I have marked the issue as P1 for team's input and attention as this is a repeated request.

@virajkanwade , appreciate your work on PR submission. Apologies, you were not able to get the needed help. Here are few resources you could use to get the required help -

  1. official CDK contribution guide - https://github.com/aws/aws-cdk/blob/main/CONTRIBUTING.md
  2. YT video walkthrough on a real pull request - https://www.youtube.com/watch?v=ZRxDwAvyQGc
  3. cdk.dev community slack #contributing channel. Please feel free to post here and someone from the community might be able to help you out.

Generally the PR review would first go through community review and then maintainers review, but if you complete the PR with CI pass I think you can cut an internal ticket to escalate the review directly to the core team. Let me know if you need any help.

@khushail khushail removed their assignment Jun 11, 2024
@khushail khushail added p2 and removed p1 needs-discussion This issue/PR requires more discussion with community. labels Jun 12, 2024
@comcalvi
Copy link
Contributor

comcalvi commented Jun 12, 2024

@karmabadger It would be helpful if you could clarify all the keys in cdk.json that you would like to specify different values for, depending on the environment. The use case you gave above suggests that you want to change the compilation command used to build your application. This is the app key in cdk.json, but you can override the value with --app on the command line.

Does that address your use case, or is there other keys you'd like to change?

@comcalvi comcalvi added the response-requested Waiting on additional info and feedback. Will move to "closing-soon" in 7 days. label Jul 2, 2024
Copy link

github-actions bot commented Jul 3, 2024

This issue has not received a response in a while. If you want to keep this issue open, please leave a comment below and auto-close will be canceled.

@github-actions github-actions bot added closing-soon This issue will automatically close in 4 days unless further comments are made. closed-for-staleness This issue was automatically closed because it hadn't received any attention in a while. and removed closing-soon This issue will automatically close in 4 days unless further comments are made. labels Jul 3, 2024
@github-actions github-actions bot closed this as completed Jul 8, 2024
@aws-cdk-automation
Copy link
Collaborator

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.

@aws aws locked as resolved and limited conversation to collaborators Jul 25, 2024
# for free to subscribe to this conversation on GitHub. Already have an account? #.
Labels
cli Issues related to the CDK CLI closed-for-staleness This issue was automatically closed because it hadn't received any attention in a while. effort/large Large work item – several weeks of effort feature-request A feature should be added or improved. p2 response-requested Waiting on additional info and feedback. Will move to "closing-soon" in 7 days.
Projects
None yet
Development

No branches or pull requests

5 participants