Skip to content

Commit

Permalink
refactor(object store): use AssumeRoleWithWebIdentity for opendal s3 (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
wcy-fdu authored Feb 23, 2024
1 parent 65550a0 commit b5e3a22
Showing 1 changed file with 0 additions and 19 deletions.
19 changes: 0 additions & 19 deletions src/object_store/src/object/opendal_engine/opendal_s3.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,30 +31,11 @@ impl OpendalObjectStore {
// Create s3 builder.
let mut builder = S3::default();
builder.bucket(&bucket);

// For AWS S3, there is no need to set an endpoint; for other S3 compatible object stores, it is necessary to set this field.
if let Ok(endpoint_url) = std::env::var("RW_S3_ENDPOINT") {
builder.endpoint(&endpoint_url);
}

if let Ok(region) = std::env::var("AWS_REGION") {
builder.region(&region);
} else {
tracing::error!("aws s3 region is not set, bucket {}", bucket);
}

if let Ok(access) = std::env::var("AWS_ACCESS_KEY_ID") {
builder.access_key_id(&access);
} else {
tracing::error!("access key id of aws s3 is not set, bucket {}", bucket);
}

if let Ok(secret) = std::env::var("AWS_SECRET_ACCESS_KEY") {
builder.secret_access_key(&secret);
} else {
tracing::error!("secret access key of aws s3 is not set, bucket {}", bucket);
}

if std::env::var("RW_IS_FORCE_PATH_STYLE").is_err() {
builder.enable_virtual_host_style();
}
Expand Down

0 comments on commit b5e3a22

Please sign in to comment.