Skip to content

Commit c011848

Browse files
Kenji Fukudafacebook-github-bot
Kenji Fukuda
authored andcommitted
Add aws sqs rust sdk to fbsource/third-party
Summary: Wanted to just add the aws-sdk-sqs dependency to rust, but our other aws-sdk-* crates were still on an unstable version (<1.0) so I had to update these all at once otherwise core dependencies would be out of whack. This mostly replicates what was done 2 months ago in {D60582035} which was reverted due to causing issues with running `buck2 test @//mode/opt-asan buck2/tests/e2e/targets_command:test_targets -- test_targets.py::test_compression`, but I can't repro that with these changes. Differential Revision: D64214028 fbshipit-source-id: 3a87c21a07ecd32ce7b581fd594f0457498fc3b4
1 parent fcb323d commit c011848

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

common/src/s3_path.rs

+10-10
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ use std::str::FromStr;
99
use std::time::Duration;
1010

1111
use aws_config::default_provider::credentials::default_provider;
12-
use aws_credential_types::cache::CredentialsCache;
12+
use aws_config::identity::IdentityCache;
1313
use regex::Regex;
1414

1515
lazy_static::lazy_static! {
@@ -50,11 +50,11 @@ impl S3Path {
5050
pub async fn copy_to_local(&self) -> Result<String, std::io::Error> {
5151
let default_provider = default_provider().await;
5252
let region = aws_sdk_s3::config::Region::new(self.get_region().clone());
53-
let aws_cfg = aws_config::from_env()
54-
.credentials_cache(
55-
CredentialsCache::lazy_builder()
53+
let aws_cfg = aws_config::defaults(aws_config::BehaviorVersion::latest())
54+
.identity_cache(
55+
IdentityCache::lazy()
5656
.load_timeout(Duration::from_secs(30))
57-
.into_credentials_cache(),
57+
.build(),
5858
)
5959
.credentials_provider(default_provider)
6060
.region(region)
@@ -97,12 +97,12 @@ impl S3Path {
9797
pub async fn copy_from_local(&self, path: impl AsRef<Path>) -> Result<(), aws_sdk_s3::Error> {
9898
let default_provider = default_provider().await;
9999
let region = aws_sdk_s3::config::Region::new(self.get_region().clone());
100-
let aws_cfg = aws_config::from_env()
100+
let aws_cfg = aws_config::defaults(aws_config::BehaviorVersion::latest())
101101
.region(region)
102-
.credentials_cache(
103-
CredentialsCache::lazy_builder()
102+
.identity_cache(
103+
IdentityCache::lazy()
104104
.load_timeout(Duration::from_secs(30))
105-
.into_credentials_cache(),
105+
.build(),
106106
)
107107
.credentials_provider(default_provider)
108108
.load()
@@ -149,7 +149,7 @@ impl S3Path {
149149
let byte_stream = aws_sdk_s3::primitives::ByteStream::read_from()
150150
.path(path.as_ref())
151151
.offset(i * chunk_size)
152-
.length(aws_smithy_http::byte_stream::Length::Exact(length))
152+
.length(aws_smithy_types::byte_stream::Length::Exact(length))
153153
.build()
154154
.await;
155155
let upload = client

0 commit comments

Comments
 (0)