diff --git a/common/src/s3_path.rs b/common/src/s3_path.rs index 615d75d..a64d1bf 100644 --- a/common/src/s3_path.rs +++ b/common/src/s3_path.rs @@ -9,7 +9,7 @@ use std::str::FromStr; use std::time::Duration; use aws_config::default_provider::credentials::default_provider; -use aws_credential_types::cache::CredentialsCache; +use aws_config::identity::IdentityCache; use regex::Regex; lazy_static::lazy_static! { @@ -50,11 +50,11 @@ impl S3Path { pub async fn copy_to_local(&self) -> Result { let default_provider = default_provider().await; let region = aws_sdk_s3::config::Region::new(self.get_region().clone()); - let aws_cfg = aws_config::from_env() - .credentials_cache( - CredentialsCache::lazy_builder() + let aws_cfg = aws_config::defaults(aws_config::BehaviorVersion::latest()) + .identity_cache( + IdentityCache::lazy() .load_timeout(Duration::from_secs(30)) - .into_credentials_cache(), + .build(), ) .credentials_provider(default_provider) .region(region) @@ -97,12 +97,12 @@ impl S3Path { pub async fn copy_from_local(&self, path: impl AsRef) -> Result<(), aws_sdk_s3::Error> { let default_provider = default_provider().await; let region = aws_sdk_s3::config::Region::new(self.get_region().clone()); - let aws_cfg = aws_config::from_env() + let aws_cfg = aws_config::defaults(aws_config::BehaviorVersion::latest()) .region(region) - .credentials_cache( - CredentialsCache::lazy_builder() + .identity_cache( + IdentityCache::lazy() .load_timeout(Duration::from_secs(30)) - .into_credentials_cache(), + .build(), ) .credentials_provider(default_provider) .load() @@ -149,7 +149,7 @@ impl S3Path { let byte_stream = aws_sdk_s3::primitives::ByteStream::read_from() .path(path.as_ref()) .offset(i * chunk_size) - .length(aws_smithy_http::byte_stream::Length::Exact(length)) + .length(aws_smithy_types::byte_stream::Length::Exact(length)) .build() .await; let upload = client