diff --git a/common/src/s3_path.rs b/common/src/s3_path.rs index cecf6f2..615d75d 100644 --- a/common/src/s3_path.rs +++ b/common/src/s3_path.rs @@ -9,8 +9,7 @@ use std::str::FromStr; use std::time::Duration; use aws_config::default_provider::credentials::default_provider; -use aws_config::BehaviorVersion; -use aws_sdk_s3::config::IdentityCache; +use aws_credential_types::cache::CredentialsCache; use regex::Regex; lazy_static::lazy_static! { @@ -51,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::defaults(BehaviorVersion::latest()) - .identity_cache( - IdentityCache::lazy() + let aws_cfg = aws_config::from_env() + .credentials_cache( + CredentialsCache::lazy_builder() .load_timeout(Duration::from_secs(30)) - .build(), + .into_credentials_cache(), ) .credentials_provider(default_provider) .region(region) @@ -98,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::defaults(BehaviorVersion::latest()) + let aws_cfg = aws_config::from_env() .region(region) - .identity_cache( - IdentityCache::lazy() + .credentials_cache( + CredentialsCache::lazy_builder() .load_timeout(Duration::from_secs(30)) - .build(), + .into_credentials_cache(), ) .credentials_provider(default_provider) .load() @@ -150,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_types::byte_stream::Length::Exact(length)) + .length(aws_smithy_http::byte_stream::Length::Exact(length)) .build() .await; let upload = client