Skip to content

Commit

Permalink
S3 Store credential provider (#494)
Browse files Browse the repository at this point in the history
Credential provider is not supplied when creating aws_config::from_env(), that leads to failure responses seen in #428.

Pass the aws_config::default_provider::credentials.default_provider into the aws_config::from_env() builder which should pick up the proper credentials for the environment based on the resolution order.
  • Loading branch information
adam-singer authored Dec 21, 2023
1 parent b12dfb8 commit 1039ea0
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions nativelink-store/src/s3_store.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ use std::time::Duration;
use std::{cmp, env};

use async_trait::async_trait;
use aws_config::default_provider::credentials;
use aws_sdk_s3::config::Region;
use aws_sdk_s3::operation::create_multipart_upload::CreateMultipartUploadOutput;
use aws_sdk_s3::operation::get_object::GetObjectError;
Expand Down Expand Up @@ -152,7 +153,9 @@ impl S3Store {
});
let s3_client = {
let http_client = HyperClientBuilder::new().build(TlsConnector::new(config, jitter_fn.clone()));
let credential_provider = credentials::default_provider().await;
let mut config_builder = aws_config::from_env()
.credentials_provider(credential_provider)
.region(Region::new(Cow::Owned(config.region.clone())))
.http_client(http_client);
// TODO(allada) When aws-sdk supports this env variable we should be able
Expand Down

0 comments on commit 1039ea0

Please sign in to comment.