From eb536988ef3655df838d0245719d1230c433d240 Mon Sep 17 00:00:00 2001 From: Stiopa Koltsov Date: Thu, 8 Aug 2024 03:55:23 -0700 Subject: [PATCH] Back out "Upgrade the Rust aws-sdk-gamelift crate to latest (1.38.0) and upgrade the rest of the AWS crates to the versions that were released alongside it" Summary: Reverting the stack D60582035 because it breaks buck2. [Writeup](https://fb.workplace.com/groups/476440319183141/posts/2722556804571470) Original commit changeset: 81bf9f3ec41a Original Phabricator Diff: D60582035 allow-large-files bypass_size_limit Reviewed By: JakobDegen Differential Revision: D60949984 fbshipit-source-id: de92d8f781bd05d83a57267e038cd5d393ecc4e5 --- common/src/s3_path.rs | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) 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