Skip to content

Commit

Permalink
Back out "Upgrade the Rust aws-sdk-gamelift crate to latest (1.38.0) …
Browse files Browse the repository at this point in the history
…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
  • Loading branch information
stepancheg authored and facebook-github-bot committed Aug 8, 2024
1 parent 1ab1af7 commit eb53698
Showing 1 changed file with 10 additions and 11 deletions.
21 changes: 10 additions & 11 deletions common/src/s3_path.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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! {
Expand Down Expand Up @@ -51,11 +50,11 @@ impl S3Path {
pub async fn copy_to_local(&self) -> Result<String, std::io::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())
.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)
Expand Down Expand Up @@ -98,12 +97,12 @@ impl S3Path {
pub async fn copy_from_local(&self, path: impl AsRef<Path>) -> 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()
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit eb53698

Please sign in to comment.