You can use format() function in terraform to concatenate two strings –
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 |
cat main.tf # --------------------------------- variable "str1" { description = "this is my 1st string" default = "cloud" } variable "str2" { description = "this is my 2nd string" default = "affaire" } output "website_name" { value = "${format("%s%s",var.str1,var.str2)}" } output "website_url" { value = "${format("%s%s%s%s","https://",var.str1,var.str2,".com")}" } # --------------------------------- terraform plan ## Returns ## + website_name = "cloudaffaire" ## + website_url = "https://cloudaffaire.com" |