Crates.io | y2hcl |
lib.rs | y2hcl |
version | 0.1.0 |
source | src |
created_at | 2023-05-19 23:23:05.38923 |
updated_at | 2023-05-19 23:23:05.38923 |
description | Convert Helm Chart Values yaml to Terraform helm_release set_value, Helm Cli --set values etc. |
homepage | |
repository | https://github.com/zoro16/y2hcl |
max_upload_size | |
id | 869145 |
size | 35,086 |
a CLI Tool to convert Yaml values file (e.g. Helm Chart Values) to the following format:
Helm cli set values, e.g. --set some.var="somevalue"
Terraform helm_release
provider set_value
Terraform helm_release
provider sensitive_value
HCL variable of type map, e.g. some_map = {"some.var" = "somevalue"}
You can install this using the cargo install command:
$ cargo install y2hcl
$ y2hcl --help
Convert Helm Chart Values yaml to Terraform helm_release set_value, Helm Cli --set values etc.
Usage: y2hcl --filename <FILENAME> --output-format <OUTPUT_FORMAT>
Options:
-f, --filename <FILENAME> Filename or full path to YAML formated Helm Chart values
-o, --output-format <OUTPUT_FORMAT> Output format is how we want our Helm Chart values to look like. Supported format are `hcl_map`, `set_value`, `sensitive_value`, `helm_cli`
-h, --help Print help
-V, --version Print version
For example, a file values.yaml
contains the following:
livenessProbe:
httpGet:
path: /user/login
port: http
initialDelaySeconds: 120
HCL Map
$ y2hcl -f values.yaml -o hcl_map
hcl_map = {
"livenessProbe.httpGet.path" = "/user/login"
"livenessProbe.httpGet.port" = "http"
"livenessProbe.initialDelaySeconds" = "120"
}
helm_release
set_value
$ y2hcl -f values.yaml -o set_value
set_value = {
name = "livenessProbe.httpGet.path"
value = "/user/login"
}
set_value = {
name = "livenessProbe.httpGet.port"
value = "http"
}
set_value = {
name = "livenessProbe.initialDelaySeconds"
value = "120"
}
helm_release
sensitive_value
$ y2hcl -f values.yaml -o sensitive_value
sensitive_value = {
name = "livenessProbe.httpGet.path"
value = "/user/login"
}
sensitive_value = {
name = "livenessProbe.httpGet.port"
value = "http"
}
sensitive_value = {
name = "livenessProbe.initialDelaySeconds"
value = "120"
}
Helm CLI
set values$ y2hcl -f values.yaml -o helm_cli
--set livenessProbe.httpGet.path="/user/login" \
--set livenessProbe.httpGet.port="http" \
--set livenessProbe.initialDelaySeconds="120" \