Skip to content

Commit

Permalink
chore: Add new Wasabi regions
Browse files Browse the repository at this point in the history
This change adds missing regions for Wasabi.
  • Loading branch information
GodTamIt committed Aug 14, 2024
1 parent 7182a4f commit c006e97
Showing 1 changed file with 49 additions and 4 deletions.
53 changes: 49 additions & 4 deletions aws-region/src/region.rs
Original file line number Diff line number Diff line change
Expand Up @@ -93,10 +93,28 @@ pub enum Region {
WaUsEast1,
/// Wasabi us-east-2
WaUsEast2,
/// Wasabi us-central-1
WaUsCentral1,
/// Wasabi us-west-1
WaUsWest1,
/// Wasabi ca-central-1
WaCaCentral1,
/// Wasabi eu-central-1
WaEuCentral1,
/// Wasabi eu-central-2
WaEuCentral2,
/// Wasabi eu-west-1
WaEuWest1,
/// Wasabi eu-west-2
WaEuWest2,
/// Wasabi ap-northeast-1
WaApNortheast1,
/// Wasabi ap-northeast-2
WaApNortheast2,
/// Wasabi ap-southeast-1
WaApSoutheast1,
/// Wasabi ap-southeast-2
WaApSoutheast2,
/// Custom region
R2 {
account_id: String,
Expand Down Expand Up @@ -140,10 +158,19 @@ impl fmt::Display for Region {
DoSgp1 => write!(f, "sgp1"),
DoFra1 => write!(f, "fra1"),
Yandex => write!(f, "ru-central1"),
WaUsEast1 => write!(f, "us-east-1"),
WaUsEast2 => write!(f, "us-east-2"),
WaUsWest1 => write!(f, "us-west-1"),
WaEuCentral1 => write!(f, "eu-central-1"),
WaUsEast1 => write!(f, "wa-us-east-1"),
WaUsEast2 => write!(f, "wa-us-east-2"),
WaUsCentral1 => write!(f, "wa-us-central-1"),
WaUsWest1 => write!(f, "wa-us-west-1"),
WaCaCentral1 => write!(f, "wa-ca-central-1"),
WaEuCentral1 => write!(f, "wa-eu-central-1"),
WaEuCentral2 => write!(f, "wa-eu-central-2"),
WaEuWest1 => write!(f, "wa-eu-west-1"),
WaEuWest2 => write!(f, "wa-eu-west-2"),
WaApNortheast1 => write!(f, "wa-ap-northeast-1"),
WaApNortheast2 => write!(f, "wa-ap-northeast-2"),
WaApSoutheast1 => write!(f, "wa-ap-southeast-1"),
WaApSoutheast2 => write!(f, "wa-ap-southeast-2"),
R2 { .. } => write!(f, "auto"),
Custom { ref region, .. } => write!(f, "{}", region),
}
Expand Down Expand Up @@ -188,8 +215,17 @@ impl FromStr for Region {
"ru-central1" => Ok(Yandex),
"wa-us-east-1" => Ok(WaUsEast1),
"wa-us-east-2" => Ok(WaUsEast2),
"wa-us-central-1" => Ok(WaUsCentral1),
"wa-us-west-1" => Ok(WaUsWest1),
"wa-ca-central-1" => Ok(WaCaCentral1),
"wa-eu-central-1" => Ok(WaEuCentral1),
"wa-eu-central-2" => Ok(WaEuCentral2),
"wa-eu-west-1" => Ok(WaEuWest1),
"wa-eu-west-2" => Ok(WaEuWest2),
"wa-ap-northeast-1" => Ok(WaApNortheast1),
"wa-ap-northeast-2" => Ok(WaApNortheast2),
"wa-ap-southeast-1" => Ok(WaApSoutheast1),
"wa-ap-southeast-2" => Ok(WaApSoutheast2),
x => Ok(Custom {
region: x.to_string(),
endpoint: x.to_string(),
Expand Down Expand Up @@ -235,8 +271,17 @@ impl Region {
Yandex => String::from("storage.yandexcloud.net"),
WaUsEast1 => String::from("s3.us-east-1.wasabisys.com"),
WaUsEast2 => String::from("s3.us-east-2.wasabisys.com"),
WaUsCentral1 => String::from("s3.us-central-1.wasabisys.com"),
WaUsWest1 => String::from("s3.us-west-1.wasabisys.com"),
WaCaCentral1 => String::from("s3.ca-central-1.wasabisys.com"),
WaEuCentral1 => String::from("s3.eu-central-1.wasabisys.com"),
WaEuCentral2 => String::from("s3.eu-central-2.wasabisys.com"),
WaEuWest1 => String::from("s3.eu-west-1.wasabisys.com"),
WaEuWest2 => String::from("s3.eu-west-2.wasabisys.com"),
WaApNortheast1 => String::from("s3.ap-northeast-1.wasabisys.com"),
WaApNortheast2 => String::from("s3.ap-northeast-2.wasabisys.com"),
WaApSoutheast1 => String::from("s3.ap-southeast-1.wasabisys.com"),
WaApSoutheast2 => String::from("s3.ap-southeast-2.wasabisys.com"),
R2 { ref account_id } => format!("{}.r2.cloudflarestorage.com", account_id),
Custom { ref endpoint, .. } => endpoint.to_string(),
}
Expand Down

0 comments on commit c006e97

Please sign in to comment.