Created
May 14, 2024 15:18
-
-
Save bdashrad/1c56d2a22677703586138b53fc9c819b to your computer and use it in GitHub Desktop.
a terrible idea
This file contains 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
# 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