Created
October 2, 2018 14:12
-
-
Save neoshrew/50f8a97ea60294d7cc142a29040bef7f to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
variable domain {} | |
locals { | |
split_domain = "${split(".", var.domain)}" | |
split_upper_domain = "${slice(local.split_domain, 1, length(local.split_domain))}" | |
upper_domain = "${join(".", local.split_upper_domain)}" | |
} | |
output sni_name { | |
value = "*${ | |
substr(var.domain, 0, 1) == "." | |
? "${var.domain}" | |
: ".${local.upper_domain}" | |
}" | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment