Skip to content

Instantly share code, notes, and snippets.

@bdashrad
Created May 14, 2024 15:18
Show Gist options
  • Save bdashrad/1c56d2a22677703586138b53fc9c819b to your computer and use it in GitHub Desktop.
Save bdashrad/1c56d2a22677703586138b53fc9c819b to your computer and use it in GitHub Desktop.
a terrible idea
# fizzbuzz.tf
variable "start" {}
variable "end" {}
output "out_text" {
value = join(
"\n", [
for i in range(var.start, var.end):
i % 15 == 0 ? "FizzBuzz" :
i % 5 == 0 ? "Buzz" :
i % 3 == 0 ? "Fizz" :
i
]
)
}
output "out_list" {
value = [
for i in range(var.start, var.end):
i % 15 == 0 ? "FizzBuzz" :
i % 5 == 0 ? "Buzz" :
i % 3 == 0 ? "Fizz" :
i
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment