Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 39 additions & 0 deletions tests/test_rds.py
Original file line number Diff line number Diff line change
Expand Up @@ -271,6 +271,45 @@ def test_gp3_storage_performance(self):
):
i.to_dict()

# Check startswith match for oracle and sqlserver engines
i = rds.DBInstance(
"Database2",
Engine="oracle-se2",
EngineVersion="15.3",
StorageType="gp3",
Iops=10000,
AllocatedStorage="10",
MasterUsername="test",
MasterUserPassword="test",
)
with self.assertRaisesRegex(
ValueError,
r"AllocatedStorage must be at least 200",
):
i.to_dict()

i.AllocatedStorage = "200"
i.to_dict()

i = rds.DBInstance(
"Database2",
Engine="sqlserver-se",
EngineVersion="15.3",
StorageType="gp3",
Iops=1000,
AllocatedStorage="10",
MasterUsername="test",
MasterUserPassword="test",
)
with self.assertRaisesRegex(
ValueError,
r"AllocatedStorage must be at least 20",
):
i.to_dict()

i.AllocatedStorage = "20"
i.to_dict()

def test_io1_storage_type_and_iops(self):
i = rds.DBInstance(
"NoAZAndMultiAZ",
Expand Down
4 changes: 2 additions & 2 deletions troposphere/validators/rds.py
Original file line number Diff line number Diff line change
Expand Up @@ -483,9 +483,9 @@ def validate_dbinstance(self) -> None:
max_iops_to_allocated_storage_ratio = 500.0
if engine in ["mariadb", "mysql", "postgres"]:
min_storage_size = 400
elif engine in ["oracle"]:
elif engine.startswith("oracle"):
min_storage_size = 200
elif engine in ["sqlserver"]:
elif engine.startswith("sqlserver"):
min_storage_size = 20
min_iops_to_allocated_storage_ratio = 0.5
else:
Expand Down