-
Notifications
You must be signed in to change notification settings - Fork 42
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
preference for alternatives over cdk.json #2
Comments
yeah, when possible, I prefer YAML because of comments and increased flexibility. |
I've only just started using this idea for a CDK project. For another project I have, I include a Example: |
wonder if it makes sense to use something like jsonnet. you get the best of all worlds since it is meant to serialize to json and has lots of high level features like comments, loops and imports (it's basically a programming language that happens to output json). if you wanted to version control config separately, you could keep the specific local config in a different folder and version control just that config.
that being said, this should only be an issue for public projects. for org projects, there should be a standard config in prod at least. dev config might differ but that could be fixed either via something like jsonnet or getting those values from the shell env |
I think your desire for a separate context file has been realized. In the latest CDK release it seems that a Unfortunately, I have been struggling to find good documentation on this. |
Well, I actually did find some more info on Evidently, "cdk.json is for humans to manage and cdk.context.json is for the CLI to manage. Both should be checked-in to ensure reproducbility of your synthesis." |
Is there a reason to use JSON/YAML over TypeScript (or any other programming language) for configuration? What's wrong about a |
mainly so that it is readable for multiple systems/languages. if you don't
have the need for that, expressing your config as a native object has lots
of benefits
…On Tue, Apr 14, 2020 at 9:16 AM Erik Müller ***@***.***> wrote:
Is there a reason to use JSON/YAML over TypeScript (or any other
programming language) for configuration? What's wrong about a config.ts
exporting a config object? Then you could benefit from type-checking,
refactoring etc.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#2 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AADD52PECPXX2JAH7LXK3H3RMSD7RANCNFSM4IKPC5UA>
.
|
The strategy I've been using has been to use a yaml file for my config values, as yaml allows comments and thus is a more human friendly format. I also like having a separate config file, especially for projects I plan to open-source, because it allows for the configuration settings to be separate from the rest of the code for the project, so you won't have conflicts in git pulls or other updates. I don't know if this goes against the expectations of the CDK project, but seems to work better for my use cases.
The text was updated successfully, but these errors were encountered: