Skip to main content

normalise_region

Function normalise_region 

Source
fn normalise_region(raw: Option<&str>) -> String
Expand description

Normalise an S3 LocationConstraint string to a canonical AWS region name.

AWS quirks handled here:

  • None / empty string → "us-east-1" (us-east-1 buckets return no constraint)
  • "EU""eu-west-1" (legacy alias from before region-specific EU endpoints)

All other values are returned as-is.