Skip to content

Commit

Permalink
Add aws sqs rust sdk to fbsource/third-party
Browse files Browse the repository at this point in the history
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
  • Loading branch information
Kenji Fukuda authored and facebook-github-bot committed Oct 18, 2024
1 parent fcb323d commit c011848
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions common/src/s3_path.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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! {
Expand Down Expand Up @@ -50,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::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)
Expand Down Expand Up @@ -97,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::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()
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit c011848

Please sign in to comment.