Skip to content

Commit 33b798c

Browse files
committed
Set timeouts only when values are given
1 parent a729331 commit 33b798c

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

main.tf

+8-4
Original file line numberDiff line numberDiff line change
@@ -112,10 +112,14 @@ resource "aws_lambda_function" "this" {
112112
}
113113
}
114114

115-
timeouts {
116-
create = try(var.timeouts.create, null)
117-
update = try(var.timeouts.update, null)
118-
delete = try(var.timeouts.delete, null)
115+
dynamic "timeouts" {
116+
for_each = length(var.timeouts) > 0 ? [true] : []
117+
118+
content {
119+
create = try(var.timeouts.create, null)
120+
update = try(var.timeouts.update, null)
121+
delete = try(var.timeouts.delete, null)
122+
}
119123
}
120124

121125
tags = merge(var.tags, var.function_tags)

0 commit comments

Comments
 (0)