Skip to content

Commit 8b6600c

Browse files
authored
fix: use try on length(var.subnets) (#179)
1 parent 62a6f87 commit 8b6600c

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

main.tf

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ locals {
99
computed_major_engine_version = var.engine == "postgres" ? join(".", slice(split(".", var.engine_version), 0, 1)) : join(".", slice(split(".", var.engine_version), 0, 2))
1010
major_engine_version = var.major_engine_version == "" ? local.computed_major_engine_version : var.major_engine_version
1111

12-
subnet_ids_provided = var.subnet_ids != null && length(var.subnet_ids) > 0
12+
subnet_ids_provided = var.subnet_ids != null && try(length(var.subnet_ids), 0) > 0
1313
db_subnet_group_name_provided = var.db_subnet_group_name != null && var.db_subnet_group_name != ""
1414
is_replica = try(length(var.replicate_source_db), 0) > 0
1515

0 commit comments

Comments
 (0)