@@ -31,6 +31,15 @@ public class RdsUtilsTests
3131 private const string UsEastRegionLimitlessDbShardGroup =
3232 "database-test-name.shardgrp-XYZ.us-east-2.rds.amazonaws.com" ;
3333
34+ private const string EuRedshift =
35+ "redshift-test-name.XYZ.eusc-de-east-1.rds.amazonaws.eu" ;
36+ private const string AuRegionInstance =
37+ "instance-test-name.XYZ.ap-southeast-2.rds.amazonaws.au" ;
38+ private const string UkRegionInstance =
39+ "instance-test-name.XYZ.eu-west-2.rds.amazonaws.uk" ;
40+ private const string RdsFipsInstance =
41+ "instance-test-name.XYZ.us-east-1.rds-fips.amazonaws.com" ;
42+
3443 private const string ChinaRegionCluster =
3544 "database-test-name.cluster-XYZ.rds.cn-northwest-1.amazonaws.com.cn" ;
3645 private const string ChinaRegionClusterReadOnly =
@@ -95,6 +104,10 @@ public class RdsUtilsTests
95104 private const string UsIsoEastRegionHostPattern = "?.XYZ.rds.us-iso-east-1.c2s.ic.gov" ;
96105 private const string ChinaRegionHostPattern = "?.XYZ.rds.cn-northwest-1.amazonaws.com.cn" ;
97106 private const string OldChinaRegionHostPattern = "?.XYZ.cn-northwest-1.rds.amazonaws.com.cn" ;
107+ private const string EuRedshiftHostPattern = "?.XYZ.eusc-de-east-1.rds.amazonaws.eu" ;
108+ private const string AuRegionHostPattern = "?.XYZ.ap-southeast-2.rds.amazonaws.au" ;
109+ private const string UkRegionHostPattern = "?.XYZ.eu-west-2.rds.amazonaws.uk" ;
110+ private const string RdsFipsHostPattern = "?.XYZ.us-east-1.rds-fips.amazonaws.com" ;
98111
99112 public static IEnumerable < object ? [ ] > IdentifyRdsTypeTestData ( )
100113 {
@@ -104,6 +117,10 @@ public class RdsUtilsTests
104117 yield return new object ? [ ] { UsEastRegionProxy , RdsUrlType . RdsProxy } ;
105118 yield return new object ? [ ] { UsEastRegionInstance , RdsUrlType . RdsInstance } ;
106119 yield return new object ? [ ] { UsEastRegionLimitlessDbShardGroup , RdsUrlType . RdsAuroraLimitlessDbShardGroup } ;
120+ yield return new object ? [ ] { EuRedshift , RdsUrlType . RdsInstance } ;
121+ yield return new object ? [ ] { AuRegionInstance , RdsUrlType . RdsInstance } ;
122+ yield return new object ? [ ] { UkRegionInstance , RdsUrlType . RdsInstance } ;
123+ yield return new object ? [ ] { RdsFipsInstance , RdsUrlType . RdsInstance } ;
107124 yield return new object ? [ ] { "192.168.1.1" , RdsUrlType . IpAddress } ;
108125 yield return new object ? [ ] { "2001:0db8:85a3:0000:0000:8a2e:0370:7334" , RdsUrlType . IpAddress } ;
109126 yield return new object ? [ ] { "2001:db8::8a2e:370:7334" , RdsUrlType . IpAddress } ;
@@ -167,6 +184,10 @@ public void IdentifyRdsType_ShouldReturnCorrectType(string? host, RdsUrlType exp
167184 [ InlineData ( UsEastRegionProxy , "proxy-test-name" ) ]
168185 [ InlineData ( UsEastRegionCustomDomain , "custom-test-name" ) ]
169186 [ InlineData ( UsEastRegionLimitlessDbShardGroup , "database-test-name" ) ]
187+ [ InlineData ( EuRedshift , "redshift-test-name" ) ]
188+ [ InlineData ( AuRegionInstance , "instance-test-name" ) ]
189+ [ InlineData ( UkRegionInstance , "instance-test-name" ) ]
190+ [ InlineData ( RdsFipsInstance , "instance-test-name" ) ]
170191 [ InlineData ( "192.168.1.1" , null ) ]
171192 [ InlineData ( "example.com" , null ) ]
172193 [ InlineData ( "" , null ) ]
@@ -232,6 +253,10 @@ public void GetRdsInstanceId_WithElbUrl_ShouldReturnNull()
232253 [ InlineData ( UsEastRegionHostPattern , UsEastRegionInstance ) ]
233254 [ InlineData ( UsEastRegionHostPattern , UsEastRegionLimitlessDbShardGroup ) ]
234255 [ InlineData ( UsEastRegionHostPattern , UsEastRegionProxy ) ]
256+ [ InlineData ( EuRedshiftHostPattern , EuRedshift ) ]
257+ [ InlineData ( AuRegionHostPattern , AuRegionInstance ) ]
258+ [ InlineData ( UkRegionHostPattern , UkRegionInstance ) ]
259+ [ InlineData ( RdsFipsHostPattern , RdsFipsInstance ) ]
235260
236261 [ InlineData ( UsGovEastRegionHostPattern , UsGovEastRegionCluster ) ]
237262
0 commit comments