Skip to content

Commit 6a6b42b

Browse files
chore: Upgrade aws-smithy and aws-sdk crates (vectordotdev#17731)
This PR changes the source of our AWS dependencies to track a fork to circumvent a currently unresolved bug upstream. Smithy crates are upgraded to `0.54.x` and sdk crates are upgraded to `0.24.x` Closes vectordotdev#17728 --------- Signed-off-by: Spencer Gilbert <[email protected]>
1 parent 6e1878b commit 6a6b42b

File tree

27 files changed

+487
-468
lines changed

27 files changed

+487
-468
lines changed

Cargo.lock

Lines changed: 250 additions & 241 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 18 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -158,21 +158,23 @@ metrics = "0.21.0"
158158
metrics-tracing-context = { version = "0.14.0", default-features = false }
159159

160160
# AWS - Official SDK
161-
aws-sdk-s3 = { version = "0.21.0", default-features = false, features = ["native-tls"], optional = true }
162-
aws-sdk-sqs = { version = "0.21.0", default-features = false, features = ["native-tls"], optional = true }
163-
aws-sdk-cloudwatch = { version = "0.21.0", default-features = false, features = ["native-tls"], optional = true }
164-
aws-sdk-cloudwatchlogs = { version = "0.21.0", default-features = false, features = ["native-tls"], optional = true }
165-
aws-sdk-elasticsearch = {version = "0.21.0", default-features = false, features = ["native-tls"], optional = true }
166-
aws-sdk-firehose = { version = "0.21.0", default-features = false, features = ["native-tls"], optional = true }
167-
aws-sdk-kinesis = { version = "0.21.0", default-features = false, features = ["native-tls"], optional = true }
168-
aws-types = { version = "0.51.0", default-features = false, features = ["hardcoded-credentials"], optional = true }
169-
aws-sigv4 = { version = "0.55.3", default-features = false, features = ["sign-http"], optional = true }
170-
aws-config = { version = "0.51.0", default-features = false, features = ["native-tls"], optional = true }
171-
aws-smithy-async = { version = "0.51.0", default-features = false, optional = true }
172-
aws-smithy-client = { version = "0.51.0", default-features = false, features = ["client-hyper"], optional = true}
173-
aws-smithy-http = { version = "0.51.0", default-features = false, features = ["event-stream"], optional = true }
174-
aws-smithy-http-tower = { version = "0.54.4", default-features = false, optional = true }
175-
aws-smithy-types = { version = "0.51.0", default-features = false, optional = true }
161+
# depending on a fork to circumvent https://github.com/awslabs/aws-sdk-rust/issues/749
162+
aws-sdk-s3 = { git = "https://github.com/vectordotdev/aws-sdk-rust", rev = "3d6aefb7fcfced5fc2a7e761a87e4ddbda1ee670", default-features = false, features = ["native-tls"], optional = true }
163+
aws-sdk-sqs = { git = "https://github.com/vectordotdev/aws-sdk-rust", rev = "3d6aefb7fcfced5fc2a7e761a87e4ddbda1ee670", default-features = false, features = ["native-tls"], optional = true }
164+
aws-sdk-cloudwatch = { git = "https://github.com/vectordotdev/aws-sdk-rust", rev = "3d6aefb7fcfced5fc2a7e761a87e4ddbda1ee670", default-features = false, features = ["native-tls"], optional = true }
165+
aws-sdk-cloudwatchlogs = { git = "https://github.com/vectordotdev/aws-sdk-rust", rev = "3d6aefb7fcfced5fc2a7e761a87e4ddbda1ee670", default-features = false, features = ["native-tls"], optional = true }
166+
aws-sdk-elasticsearch = { git = "https://github.com/vectordotdev/aws-sdk-rust", rev = "3d6aefb7fcfced5fc2a7e761a87e4ddbda1ee670", default-features = false, features = ["native-tls"], optional = true }
167+
aws-sdk-firehose = { git = "https://github.com/vectordotdev/aws-sdk-rust", rev = "3d6aefb7fcfced5fc2a7e761a87e4ddbda1ee670", default-features = false, features = ["native-tls"], optional = true }
168+
aws-sdk-kinesis = { git = "https://github.com/vectordotdev/aws-sdk-rust", rev = "3d6aefb7fcfced5fc2a7e761a87e4ddbda1ee670", default-features = false, features = ["native-tls"], optional = true }
169+
aws-types = { git = "https://github.com/vectordotdev/aws-sdk-rust", rev = "3d6aefb7fcfced5fc2a7e761a87e4ddbda1ee670", default-features = false, optional = true }
170+
aws-sigv4 = { git = "https://github.com/vectordotdev/aws-sdk-rust", rev = "3d6aefb7fcfced5fc2a7e761a87e4ddbda1ee670", default-features = false, features = ["sign-http"], optional = true }
171+
aws-config = { git = "https://github.com/vectordotdev/aws-sdk-rust", rev = "3d6aefb7fcfced5fc2a7e761a87e4ddbda1ee670", default-features = false, features = ["native-tls"], optional = true }
172+
aws-credential-types = { git = "https://github.com/vectordotdev/aws-sdk-rust", rev = "3d6aefb7fcfced5fc2a7e761a87e4ddbda1ee670", default-features = false, features = ["hardcoded-credentials"], optional = true }
173+
aws-smithy-async = { git = "https://github.com/vectordotdev/aws-sdk-rust", rev = "3d6aefb7fcfced5fc2a7e761a87e4ddbda1ee670", default-features = false, optional = true }
174+
aws-smithy-client = { git = "https://github.com/vectordotdev/aws-sdk-rust", rev = "3d6aefb7fcfced5fc2a7e761a87e4ddbda1ee670", default-features = false, features = ["client-hyper"], optional = true}
175+
aws-smithy-http = { git = "https://github.com/vectordotdev/aws-sdk-rust", rev = "3d6aefb7fcfced5fc2a7e761a87e4ddbda1ee670", default-features = false, features = ["event-stream"], optional = true }
176+
aws-smithy-http-tower = { git = "https://github.com/vectordotdev/aws-sdk-rust", rev = "3d6aefb7fcfced5fc2a7e761a87e4ddbda1ee670", default-features = false, optional = true }
177+
aws-smithy-types = { git = "https://github.com/vectordotdev/aws-sdk-rust", rev = "3d6aefb7fcfced5fc2a7e761a87e4ddbda1ee670", default-features = false, optional = true }
176178

177179
# Azure
178180
azure_core = { git = "https://github.com/Azure/azure-sdk-for-rust.git", rev = "b4544d4920fa3064eb921340054cd9cc130b7664", default-features = false, features = ["enable_reqwest"], optional = true }
@@ -434,6 +436,7 @@ api-client = [
434436

435437
aws-core = [
436438
"aws-config",
439+
"dep:aws-credential-types",
437440
"dep:aws-sigv4",
438441
"dep:aws-types",
439442
"dep:aws-smithy-async",

LICENSE-3rdparty.csv

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ arc-swap,https://github.com/vorner/arc-swap,MIT OR Apache-2.0,Michal 'vorner' Va
1818
arr_macro,https://github.com/JoshMcguigan/arr_macro,MIT OR Apache-2.0,Josh Mcguigan
1919
arrayvec,https://github.com/bluss/arrayvec,MIT OR Apache-2.0,bluss
2020
ascii,https://github.com/tomprogrammer/rust-ascii,Apache-2.0 OR MIT,"Thomas Bahn <[email protected]>, Torbjørn Birch Moltu <[email protected]>, Simon Sapin <[email protected]>"
21+
assert-json-diff,https://github.com/davidpdrsn/assert-json-diff,MIT,David Pedersen <[email protected]>
2122
async-channel,https://github.com/smol-rs/async-channel,Apache-2.0 OR MIT,Stjepan Glavina <[email protected]>
2223
async-compat,https://github.com/smol-rs/async-compat,Apache-2.0 OR MIT,Stjepan Glavina <[email protected]>
2324
async-compression,https://github.com/Nemo157/async-compression,MIT OR Apache-2.0,"Wim Looman <[email protected]>, Allen Bui <[email protected]>"
@@ -38,6 +39,7 @@ async-trait,https://github.com/dtolnay/async-trait,MIT OR Apache-2.0,David Tolna
3839
atomic-waker,https://github.com/stjepang/atomic-waker,Apache-2.0 OR MIT,Stjepan Glavina <[email protected]>
3940
atty,https://github.com/softprops/atty,MIT,softprops <[email protected]>
4041
aws-config,https://github.com/awslabs/smithy-rs,Apache-2.0,"AWS Rust SDK Team <[email protected]>, Russell Cohen <[email protected]>"
42+
aws-credential-types,https://github.com/awslabs/smithy-rs,Apache-2.0,AWS Rust SDK Team <[email protected]>
4143
aws-endpoint,https://github.com/awslabs/smithy-rs,Apache-2.0,"AWS Rust SDK Team <[email protected]>, Russell Cohen <[email protected]>"
4244
aws-http,https://github.com/awslabs/smithy-rs,Apache-2.0,"AWS Rust SDK Team <[email protected]>, Russell Cohen <[email protected]>"
4345
aws-sdk-cloudwatch,https://github.com/awslabs/aws-sdk-rust,Apache-2.0,"AWS Rust SDK Team <[email protected]>, Russell Cohen <[email protected]>"
@@ -57,6 +59,7 @@ aws-smithy-eventstream,https://github.com/awslabs/smithy-rs,Apache-2.0,"AWS Rust
5759
aws-smithy-http,https://github.com/awslabs/smithy-rs,Apache-2.0,"AWS Rust SDK Team <[email protected]>, Russell Cohen <[email protected]>"
5860
aws-smithy-http-tower,https://github.com/awslabs/smithy-rs,Apache-2.0,"AWS Rust SDK Team <[email protected]>, Russell Cohen <[email protected]>"
5961
aws-smithy-json,https://github.com/awslabs/smithy-rs,Apache-2.0,"AWS Rust SDK Team <[email protected]>, John DiSanti <[email protected]>"
62+
aws-smithy-protocol-test,https://github.com/awslabs/smithy-rs,Apache-2.0,"AWS Rust SDK Team <[email protected]>, Russell Cohen <[email protected]>"
6063
aws-smithy-query,https://github.com/awslabs/smithy-rs,Apache-2.0,"AWS Rust SDK Team <[email protected]>, John DiSanti <[email protected]>"
6164
aws-smithy-types,https://github.com/awslabs/smithy-rs,Apache-2.0,"AWS Rust SDK Team <[email protected]>, Russell Cohen <[email protected]>"
6265
aws-smithy-xml,https://github.com/awslabs/smithy-rs,Apache-2.0,"AWS Rust SDK Team <[email protected]>, Russell Cohen <[email protected]>"
@@ -138,6 +141,7 @@ crossterm,https://github.com/crossterm-rs/crossterm,MIT,T. Post
138141
crossterm_winapi,https://github.com/crossterm-rs/crossterm-winapi,MIT,T. Post
139142
crypto-common,https://github.com/RustCrypto/traits,MIT OR Apache-2.0,RustCrypto Developers
140143
csv,https://github.com/BurntSushi/rust-csv,Unlicense OR MIT,Andrew Gallant <[email protected]>
144+
ctor,https://github.com/mmastrac/rust-ctor,Apache-2.0 OR MIT,Matt Mastracci <[email protected]>
141145
ctr,https://github.com/RustCrypto/block-modes,MIT OR Apache-2.0,RustCrypto Developers
142146
cty,https://github.com/japaric/cty,MIT OR Apache-2.0,Jorge Aparicio <[email protected]>
143147
curve25519-dalek,https://github.com/dalek-cryptography/curve25519-dalek,BSD-3-Clause,"Isis Lovecruft <[email protected]>, Henry de Valence <[email protected]>"
@@ -151,6 +155,7 @@ der,https://github.com/RustCrypto/formats/tree/master/der,Apache-2.0 OR MIT,Rust
151155
derivative,https://github.com/mcarton/rust-derivative,MIT OR Apache-2.0,mcarton <[email protected]>
152156
derive_arbitrary,https://github.com/rust-fuzz/arbitrary,MIT OR Apache-2.0,"The Rust-Fuzz Project Developers, Nick Fitzgerald <[email protected]>, Manish Goregaokar <[email protected]>, Andre Bogus <[email protected]>, Corey Farwell <[email protected]>"
153157
derive_more,https://github.com/JelteF/derive_more,MIT,Jelte Fennema <[email protected]>
158+
diff,https://github.com/utkarshkukreti/diff.rs,MIT OR Apache-2.0,Utkarsh Kukreti <[email protected]>
154159
digest,https://github.com/RustCrypto/traits,MIT OR Apache-2.0,RustCrypto Developers
155160
dirs,https://github.com/soc/dirs-rs,MIT OR Apache-2.0,Simon Ochsenreither <[email protected]>
156161
dirs-next,https://github.com/xdg-rs/dirs,MIT OR Apache-2.0,The @xdg-rs members
@@ -177,6 +182,7 @@ error-code,https://github.com/DoumanAsh/error-code,BSL-1.0,Douman <[email protected]
177182
event-listener,https://github.com/smol-rs/event-listener,Apache-2.0 OR MIT,Stjepan Glavina <[email protected]>
178183
executor-trait,https://github.com/amqp-rs/executor-trait,Apache-2.0 OR MIT,Marc-Antoine Perennou <[email protected]>
179184
exitcode,https://github.com/benwilber/exitcode,Apache-2.0,Ben Wilber <[email protected]>
185+
extend,https://github.com/davidpdrsn/ext,MIT,David Pedersen <[email protected]>
180186
fakedata_generator,https://github.com/kevingimbel/fakedata_generator,MIT,Kevin Gimbel <[email protected]>
181187
fallible-iterator,https://github.com/sfackler/rust-fallible-iterator,MIT OR Apache-2.0,Steven Fackler <[email protected]>
182188
fastrand,https://github.com/smol-rs/fastrand,Apache-2.0 OR MIT,Stjepan Glavina <[email protected]>
@@ -351,6 +357,7 @@ openssl-macros,https://github.com/sfackler/rust-openssl,MIT OR Apache-2.0,The op
351357
openssl-probe,https://github.com/alexcrichton/openssl-probe,MIT OR Apache-2.0,Alex Crichton <[email protected]>
352358
openssl-sys,https://github.com/sfackler/rust-openssl,MIT,"Alex Crichton <[email protected]>, Steven Fackler <[email protected]>"
353359
ordered-float,https://github.com/reem/rust-ordered-float,MIT,"Jonathan Reem <[email protected]>, Matt Brubeck <[email protected]>"
360+
output_vt100,https://github.com/Phundrak/output-vt100-rs,MIT,Phuntsok Drak-pa <[email protected]>
354361
outref,https://github.com/Nugine/outref,MIT,The outref Authors
355362
overload,https://github.com/danaugrs/overload,MIT,Daniel Salvadori <[email protected]>
356363
pad,https://github.com/ogham/rust-pad,MIT,Ben S <[email protected]>
@@ -376,6 +383,7 @@ postgres-openssl,https://github.com/sfackler/rust-postgres,MIT OR Apache-2.0,Ste
376383
postgres-protocol,https://github.com/sfackler/rust-postgres,MIT OR Apache-2.0,Steven Fackler <[email protected]>
377384
postgres-types,https://github.com/sfackler/rust-postgres,MIT OR Apache-2.0,Steven Fackler <[email protected]>
378385
ppv-lite86,https://github.com/cryptocorrosion/cryptocorrosion,MIT OR Apache-2.0,The CryptoCorrosion Contributors
386+
pretty_assertions,https://github.com/rust-pretty-assertions/rust-pretty-assertions,MIT OR Apache-2.0,"Colin Kiegel <[email protected]>, Florent Fayolle <[email protected]>, Tom Milligan <[email protected]>"
379387
prettydiff,https://github.com/romankoblov/prettydiff,MIT,Roman Koblov <[email protected]>
380388
prettytable-rs,https://github.com/phsym/prettytable-rs,BSD-3-Clause,Pierre-Henri Symoneaux
381389
proc-macro-crate,https://github.com/bkchr/proc-macro-crate,Apache-2.0 OR MIT,Bastian Köcher <[email protected]>
@@ -420,6 +428,7 @@ rmp,https://github.com/3Hren/msgpack-rust,MIT,Evgeny Safronov <division494@gmail
420428
rmp-serde,https://github.com/3Hren/msgpack-rust,MIT,Evgeny Safronov <[email protected]>
421429
rmpv,https://github.com/3Hren/msgpack-rust,MIT,Evgeny Safronov <[email protected]>
422430
roaring,https://github.com/RoaringBitmap/roaring-rs,MIT OR Apache-2.0,"Wim Looman <[email protected]>, Kerollmops <[email protected]>"
431+
roxmltree,https://github.com/RazrFalcon/roxmltree,MIT OR Apache-2.0,Evgeniy Reizner <[email protected]>
423432
roxmltree,https://github.com/RazrFalcon/roxmltree,MIT OR Apache-2.0,Yevhenii Reizner <[email protected]>
424433
rust_decimal,https://github.com/paupino/rust-decimal,MIT,Paul Mason <[email protected]>
425434
rustc-hash,https://github.com/rust-lang-nursery/rustc-hash,Apache-2.0 OR MIT,The Rust Project Developers
@@ -473,6 +482,7 @@ signal-hook,https://github.com/vorner/signal-hook,Apache-2.0 OR MIT,"Michal 'vor
473482
signal-hook-registry,https://github.com/vorner/signal-hook,Apache-2.0 OR MIT,"Michal 'vorner' Vaner <[email protected]>, Masaki Hara <[email protected]>"
474483
signatory,https://github.com/iqlusioninc/crates/tree/main/signatory,Apache-2.0 OR MIT,Tony Arcieri <[email protected]>
475484
signature,https://github.com/RustCrypto/traits/tree/master/signature,Apache-2.0 OR MIT,RustCrypto Developers
485+
simd-abstraction,https://github.com/Nugine/simd,MIT,The simd-abstraction Authors
476486
simpl,https://github.com/durch/simplerr,MIT,Drazen Urch <[email protected]>
477487
siphasher,https://github.com/jedisct1/rust-siphash,MIT OR Apache-2.0,Frank Denis <[email protected]>
478488
sketches-ddsketch,https://github.com/mheffner/rust-sketches-ddsketch,Apache-2.0,Mike Heffner <[email protected]>
@@ -571,7 +581,6 @@ valuable,https://github.com/tokio-rs/valuable,MIT,The valuable Authors
571581
vec_map,https://github.com/contain-rs/vec-map,MIT OR Apache-2.0,"Alex Crichton <[email protected]>, Jorge Aparicio <[email protected]>, Alexis Beingessner <[email protected]>, Brian Anderson <>, tbu- <>, Manish Goregaokar <>, Aaron Turon <[email protected]>, Adolfo Ochagavía <>, Niko Matsakis <>, Steven Fackler <>, Chase Southwood <[email protected]>, Eduard Burtescu <>, Florian Wilkens <>, Félix Raimundo <>, Tibor Benke <>, Markus Siemens <[email protected]>, Josh Branchaud <[email protected]>, Huon Wilson <[email protected]>, Corey Farwell <[email protected]>, Aaron Liblong <>, Nick Cameron <[email protected]>, Patrick Walton <[email protected]>, Felix S Klock II <>, Andrew Paseltiner <[email protected]>, Sean McArthur <[email protected]>, Vadim Petrochenkov <>"
572582
void,https://github.com/reem/rust-void,MIT,Jonathan Reem <[email protected]>
573583
vrl,https://github.com/vectordotdev/vrl,MPL-2.0,Vector Contributors <[email protected]>
574-
vsimd,https://github.com/Nugine/simd,MIT,The vsimd Authors
575584
vte,https://github.com/alacritty/vte,Apache-2.0 OR MIT,"Joe Wilm <[email protected]>, Christian Duerr <[email protected]>"
576585
vte_generate_state_changes,https://github.com/jwilm/vte,Apache-2.0 OR MIT,Christian Duerr <[email protected]>
577586
wait-timeout,https://github.com/alexcrichton/wait-timeout,MIT OR Apache-2.0,Alex Crichton <[email protected]>
@@ -613,6 +622,7 @@ wyz,https://github.com/myrrlyn/wyz,MIT,myrrlyn <[email protected]>
613622
xml-rs,https://github.com/kornelski/xml-rs,MIT,Vladimir Matveev <[email protected]>
614623
xmlparser,https://github.com/RazrFalcon/xmlparser,MIT OR Apache-2.0,Evgeniy Reizner <[email protected]>
615624
yaml-rust,https://github.com/chyh1990/yaml-rust,MIT OR Apache-2.0,Yuheng Chen <[email protected]>
625+
yansi,https://github.com/SergioBenitez/yansi,MIT OR Apache-2.0,Sergio Benitez <[email protected]>
616626
zerocopy,https://fuchsia.googlesource.com/fuchsia/+/HEAD/src/lib/zerocopy,BSD-2-Clause,Joshua Liebow-Feeser <[email protected]>
617627
zerocopy-derive,https://github.com/google/zerocopy,BSD-2-Clause,Joshua Liebow-Feeser <[email protected]>
618628
zeroize,https://github.com/RustCrypto/utils/tree/master/zeroize,Apache-2.0 OR MIT,The RustCrypto Project Developers

src/aws/auth.rs

Lines changed: 33 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,10 @@ use aws_config::{
99
},
1010
sts::AssumeRoleProviderBuilder,
1111
};
12-
use aws_types::{credentials::SharedCredentialsProvider, region::Region, Credentials};
12+
use aws_credential_types::{
13+
cache::CredentialsCache, provider::SharedCredentialsProvider, Credentials,
14+
};
15+
use aws_types::region::Region;
1316
use serde_with::serde_as;
1417
use vector_common::sensitive_string::SensitiveString;
1518
use vector_config::configurable_component;
@@ -165,6 +168,28 @@ fn default_profile() -> String {
165168
}
166169

167170
impl AwsAuthentication {
171+
pub async fn credentials_cache(&self) -> crate::Result<CredentialsCache> {
172+
match self {
173+
AwsAuthentication::Role {
174+
load_timeout_secs, ..
175+
}
176+
| AwsAuthentication::Default {
177+
load_timeout_secs, ..
178+
} => {
179+
let credentials_cache = CredentialsCache::lazy_builder()
180+
.load_timeout(
181+
load_timeout_secs
182+
.map(Duration::from_secs)
183+
.unwrap_or(DEFAULT_LOAD_TIMEOUT),
184+
)
185+
.into_credentials_cache();
186+
187+
Ok(credentials_cache)
188+
}
189+
_ => Ok(CredentialsCache::lazy()),
190+
}
191+
}
192+
168193
pub async fn credentials_provider(
169194
&self,
170195
service_region: Region,
@@ -207,28 +232,20 @@ impl AwsAuthentication {
207232
}
208233
AwsAuthentication::Role {
209234
assume_role,
210-
load_timeout_secs,
211235
imds,
212236
region,
237+
..
213238
} => {
214239
let auth_region = region.clone().map(Region::new).unwrap_or(service_region);
215240
let provider = AssumeRoleProviderBuilder::new(assume_role)
216241
.region(auth_region.clone())
217-
.build(
218-
default_credentials_provider(auth_region, *load_timeout_secs, *imds)
219-
.await?,
220-
);
242+
.build(default_credentials_provider(auth_region, *imds).await?);
221243

222244
Ok(SharedCredentialsProvider::new(provider))
223245
}
224-
AwsAuthentication::Default {
225-
load_timeout_secs,
226-
imds,
227-
region,
228-
} => Ok(SharedCredentialsProvider::new(
246+
AwsAuthentication::Default { imds, region, .. } => Ok(SharedCredentialsProvider::new(
229247
default_credentials_provider(
230248
region.clone().map(Region::new).unwrap_or(service_region),
231-
*load_timeout_secs,
232249
*imds,
233250
)
234251
.await?,
@@ -249,7 +266,6 @@ impl AwsAuthentication {
249266

250267
async fn default_credentials_provider(
251268
region: Region,
252-
load_timeout_secs: Option<u64>,
253269
imds: ImdsAuthentication,
254270
) -> crate::Result<SharedCredentialsProvider> {
255271
let client = imds::Client::builder()
@@ -259,16 +275,13 @@ async fn default_credentials_provider(
259275
.build()
260276
.await?;
261277

262-
let chain = DefaultCredentialsChain::builder()
278+
let credentials_provider = DefaultCredentialsChain::builder()
263279
.region(region)
264280
.imds_client(client)
265-
.load_timeout(
266-
load_timeout_secs
267-
.map(Duration::from_secs)
268-
.unwrap_or(DEFAULT_LOAD_TIMEOUT),
269-
);
281+
.build()
282+
.await;
270283

271-
Ok(SharedCredentialsProvider::new(chain.build().await))
284+
Ok(SharedCredentialsProvider::new(credentials_provider))
272285
}
273286

274287
#[cfg(test)]

0 commit comments

Comments
 (0)