Skip to content

Commit

Permalink
Upgrade the Rust aws-sdk-gamelift crate to latest (1.38.0) and upgrad…
Browse files Browse the repository at this point in the history
…e the rest of the AWS crates to the versions that were released alongside it

Summary:
[release-2024-07-29](https://github.com/awslabs/aws-sdk-rust/releases/tag/release-2024-07-29) is the aws-sdk-rust release that the other crates' versions were pulled from.

**Why?**

I need [CreateFleet](https://docs.aws.amazon.com/gamelift/latest/apireference/API_CreateFleet.html)'s [InstanceRoleCredentialsProvider](https://docs.aws.amazon.com/gamelift/latest/apireference/API_CreateFleet.html#gamelift-CreateFleet-request-InstanceRoleCredentialsProvider) parameter.

**Changes**

* The new AWS SDK requires ring 0.17.5 or later, so ring was upgraded from 0.17.3 to 0.17.8 and I had to add fixups to get it building for Windows.
* [aws-smithy-client](https://crates.io/crates/aws-smithy-client) was replaced by [aws-smithy-runtime](https://crates.io/crates/aws-smithy-runtime) and [aws-smithy-runtime-api](https://crates.io/crates/aws-smithy-runtime-api).
* ```aws_smithy_http::body``` was moved to ```aws_smithy_types::body```.
* ```aws_smithy_http::byte_stream``` was moved to ```aws_smithy_types::byte_stream```.
* Struct members modeled as required are no longer wrapped in ```Option```s [when possible](https://smithy.io/2.0/spec/aggregate-types.html#structure-member-optionality).

allow-large-files
bypass_size_limit

Approved commit size limit bypass request: https://fb.workplace.com/groups/scm/permalink/7831552160227669/

Reviewed By: dtolnay

Differential Revision: D60582035

fbshipit-source-id: 81bf9f3ec41abed20a6a6fa109d0509c447227fa
  • Loading branch information
Pete Tummillo authored and facebook-github-bot committed Aug 7, 2024
1 parent 58af4ef commit 1ab1af7
Showing 1 changed file with 11 additions and 10 deletions.
21 changes: 11 additions & 10 deletions common/src/s3_path.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ 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::BehaviorVersion;
use aws_sdk_s3::config::IdentityCache;
use regex::Regex;

lazy_static::lazy_static! {
Expand Down Expand Up @@ -50,11 +51,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(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 +98,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(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 +150,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 1ab1af7

Please sign in to comment.