Skip to content

Commit

Permalink
feat: add client.region (#623)
Browse files Browse the repository at this point in the history
  • Loading branch information
jdockerty authored Sep 9, 2024
1 parent a5aba9a commit f78c59b
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions crates/iceberg/src/io/storage_s3.rs
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,10 @@ pub const S3_SECRET_ACCESS_KEY: &str = "s3.secret-access-key";
pub const S3_SESSION_TOKEN: &str = "s3.session-token";
/// S3 region.
pub const S3_REGION: &str = "s3.region";
/// Region to use for the S3 client.
///
/// This takes precedence over [`S3_REGION`].
pub const CLIENT_REGION: &str = "client.region";
/// S3 Path Style Access.
pub const S3_PATH_STYLE_ACCESS: &str = "s3.path-style-access";
/// S3 Server Side Encryption Type.
Expand Down Expand Up @@ -73,6 +77,9 @@ pub(crate) fn s3_config_parse(mut m: HashMap<String, String>) -> Result<S3Config
if let Some(region) = m.remove(S3_REGION) {
cfg.region = Some(region);
};
if let Some(region) = m.remove(CLIENT_REGION) {
cfg.region = Some(region);
};
if let Some(path_style_access) = m.remove(S3_PATH_STYLE_ACCESS) {
if ["true", "True", "1"].contains(&path_style_access.as_str()) {
cfg.enable_virtual_host_style = true;
Expand Down

0 comments on commit f78c59b

Please sign in to comment.