Skip to content

Commit

Permalink
chore: update validation
Browse files Browse the repository at this point in the history
  • Loading branch information
timckt committed Sep 25, 2024
1 parent 6030a50 commit 1adbb41
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,6 @@ resource "aws_db_instance" "rds" {
lifecycle {
precondition {
condition = var.storage_type != "io2" || (var.db_iops != null ? var.db_iops >= 1000 : false)
# condition = var.storage_type != "io2" || (var.db_iops != null && var.db_iops >= 1000)
error_message = "When 'storage_type' is 'io2', 'db_iops' must be specified and at least 1000."
}

Expand All @@ -223,10 +222,10 @@ resource "aws_db_instance" "rds" {
# error_message = "When 'storage_type' is 'io2', 'db_allocated_storage' must be at least 100 GiB unless using SQL which must be at least 20 GiB."
# }

# precondition {
# condition = var.storage_type != "gp3" || var.db_allocated_storage >= 20
# error_message = "When 'storage_type' is 'gp3', 'db_allocated_storage' must be at least 20 GiB."
# }
precondition {
condition = var.storage_type != "gp3" || var.db_allocated_storage >= 20
error_message = "When 'storage_type' is 'gp3', 'db_allocated_storage' must be at least 20 GiB."
}

# precondition {
# condition = var.storage_type != "gp3" || contains(["sqlserver-ee", "sqlserver-se", "sqlserver-ex", "sqlserver-web"], var.db_engine) || (
Expand Down

0 comments on commit 1adbb41

Please sign in to comment.