Skip to content

Commit f78c59b

Browse files
authored
feat: add client.region (apache#623)
1 parent a5aba9a commit f78c59b

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

crates/iceberg/src/io/storage_s3.rs

+7
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,10 @@ pub const S3_SECRET_ACCESS_KEY: &str = "s3.secret-access-key";
3636
pub const S3_SESSION_TOKEN: &str = "s3.session-token";
3737
/// S3 region.
3838
pub const S3_REGION: &str = "s3.region";
39+
/// Region to use for the S3 client.
40+
///
41+
/// This takes precedence over [`S3_REGION`].
42+
pub const CLIENT_REGION: &str = "client.region";
3943
/// S3 Path Style Access.
4044
pub const S3_PATH_STYLE_ACCESS: &str = "s3.path-style-access";
4145
/// S3 Server Side Encryption Type.
@@ -73,6 +77,9 @@ pub(crate) fn s3_config_parse(mut m: HashMap<String, String>) -> Result<S3Config
7377
if let Some(region) = m.remove(S3_REGION) {
7478
cfg.region = Some(region);
7579
};
80+
if let Some(region) = m.remove(CLIENT_REGION) {
81+
cfg.region = Some(region);
82+
};
7683
if let Some(path_style_access) = m.remove(S3_PATH_STYLE_ACCESS) {
7784
if ["true", "True", "1"].contains(&path_style_access.as_str()) {
7885
cfg.enable_virtual_host_style = true;

0 commit comments

Comments
 (0)