mirror of
https://github.com/bertptrs/adventofcode.git
synced 2025-12-27 22:00:31 +01:00
Implement day 2 in Terraform
This commit is contained in:
17
2024/bonus/day02/is_savable/main.tf
Normal file
17
2024/bonus/day02/is_savable/main.tf
Normal file
@@ -0,0 +1,17 @@
|
||||
variable "report" {
|
||||
type = list(number)
|
||||
}
|
||||
|
||||
module "is_valid" {
|
||||
source = "../is_valid"
|
||||
count = length(var.report)
|
||||
|
||||
report = concat(
|
||||
count.index > 0 ? slice(var.report, 0, count.index) : [],
|
||||
count.index < length(var.report) - 1 ? slice(var.report, count.index + 1, length(var.report)) : []
|
||||
)
|
||||
}
|
||||
|
||||
output "valid" {
|
||||
value = anytrue(module.is_valid[*].valid)
|
||||
}
|
||||
Reference in New Issue
Block a user