Skip to content

Latest commit

 

History

History
64 lines (45 loc) · 1.97 KB

README.md

File metadata and controls

64 lines (45 loc) · 1.97 KB

terraform-string-convert-format

このリポジトリは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"
}

Requirements

Name Version
terraform >= 1.4.0

Providers

No providers.

Modules

No modules.

Resources

No resources.

Inputs

Name Description Type Default Required
str Specify the string you want to convert. string n/a yes

Outputs

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"
}