このリポジトリはstring型の文字列をcamelcase、snakecaseなど様々なformatで返すterraform moduleです。
このModuleを使うと、特定のServiceのname属性に「-」が使えない文字列があった際に、変換処理を自分で書かなくても良くなります。
使い方は、各単語ごとに半角スペースで区切った文字列をstrに指定するだけです。
Usage:
module "terraform_string_convert_format" {
source = "git@github.com:hacomono/terraform-string-convert-format.git"
str = "hello new world"
}
Output:
terraform_string_convert_format = {
"pure" = "hello new world"
"camelcase" = "helloNewWorld"
"kebabcase" = "hello-new-world"
"lower" = "hello new world"
"pascalcase" = "HelloNewWorld"
"snakecase" = "hello_new_world"
"upper" = "HELLO NEW WORLD"
"uppercamelcase" = "HelloNewWorld"
"upperkebabcase" = "Hello-New-World"
}
Name | Version |
---|---|
terraform | >= 1.4.0 |
No providers.
No modules.
No resources.
Name | Description | Type | Default | Required |
---|---|---|---|---|
str | Specify the string you want to convert. | string |
n/a | yes |
Name | Description |
---|---|
formats | output sample: terraform_string_convert_format = { "pure" = "hello new world" "camelcase" = "helloNewWorld" "kebabcase" = "hello-new-world" "lower" = "hello new world" "pascalcase" = "HelloNewWorld" "snakecase" = "hello_new_world" "upper" = "HELLO NEW WORLD" "uppercamelcase" = "HelloNewWorld" "upperkebabcase" = "Hello-New-World" } |