Crates.io | aws-region |
lib.rs | aws-region |
version | 0.27.0 |
source | src |
created_at | 2020-03-28 14:30:29.690137 |
updated_at | 2024-09-06 18:33:47.242591 |
description | Tiny Rust library for working with Amazon AWS regions, supports `s3` crate |
homepage | |
repository | https://github.com/durch/rust-s3 |
max_upload_size | |
id | 223827 |
size | 16,869 |
AWS S3 region identifier, passing in custom values is also possible, in that case it is up to you to pass a valid endpoint, otherwise boom will happen :)
use std::str::FromStr;
use awsregion::Region;
// Parse from a string
let region: Region = "us-east-1".parse().unwrap();
// Choose region directly
let region = Region::EuWest2;
// Custom region requires valid region name and endpoint
let region_name = "nl-ams".to_string();
let endpoint = "https://s3.nl-ams.scw.cloud".to_string();
let region = Region::Custom { region: region_name, endpoint };