Skip to content

Instantly share code, notes, and snippets.

@neoshrew
Created October 2, 2018 14:12
Show Gist options
  • Save neoshrew/50f8a97ea60294d7cc142a29040bef7f to your computer and use it in GitHub Desktop.
Save neoshrew/50f8a97ea60294d7cc142a29040bef7f to your computer and use it in GitHub Desktop.
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