Skip to content

Commit

Permalink
chore: Upgrade aws-smithy and aws-sdk crates (vectordotdev#17731)
Browse files Browse the repository at this point in the history
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]>
  • Loading branch information
spencergilbert authored Jun 26, 2023
1 parent 6e1878b commit 6a6b42b
Show file tree
Hide file tree
Showing 27 changed files with 487 additions and 468 deletions.
491 changes: 250 additions & 241 deletions Cargo.lock

Large diffs are not rendered by default.

33 changes: 18 additions & 15 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -158,21 +158,23 @@ metrics = "0.21.0"
metrics-tracing-context = { version = "0.14.0", default-features = false }

# AWS - Official SDK
aws-sdk-s3 = { version = "0.21.0", default-features = false, features = ["native-tls"], optional = true }
aws-sdk-sqs = { version = "0.21.0", default-features = false, features = ["native-tls"], optional = true }
aws-sdk-cloudwatch = { version = "0.21.0", default-features = false, features = ["native-tls"], optional = true }
aws-sdk-cloudwatchlogs = { version = "0.21.0", default-features = false, features = ["native-tls"], optional = true }
aws-sdk-elasticsearch = {version = "0.21.0", default-features = false, features = ["native-tls"], optional = true }
aws-sdk-firehose = { version = "0.21.0", default-features = false, features = ["native-tls"], optional = true }
aws-sdk-kinesis = { version = "0.21.0", default-features = false, features = ["native-tls"], optional = true }
aws-types = { version = "0.51.0", default-features = false, features = ["hardcoded-credentials"], optional = true }
aws-sigv4 = { version = "0.55.3", default-features = false, features = ["sign-http"], optional = true }
aws-config = { version = "0.51.0", default-features = false, features = ["native-tls"], optional = true }
aws-smithy-async = { version = "0.51.0", default-features = false, optional = true }
aws-smithy-client = { version = "0.51.0", default-features = false, features = ["client-hyper"], optional = true}
aws-smithy-http = { version = "0.51.0", default-features = false, features = ["event-stream"], optional = true }
aws-smithy-http-tower = { version = "0.54.4", default-features = false, optional = true }
aws-smithy-types = { version = "0.51.0", default-features = false, optional = true }
# depending on a fork to circumvent https://github.com/awslabs/aws-sdk-rust/issues/749
aws-sdk-s3 = { git = "https://github.com/vectordotdev/aws-sdk-rust", rev = "3d6aefb7fcfced5fc2a7e761a87e4ddbda1ee670", default-features = false, features = ["native-tls"], optional = true }
aws-sdk-sqs = { git = "https://github.com/vectordotdev/aws-sdk-rust", rev = "3d6aefb7fcfced5fc2a7e761a87e4ddbda1ee670", default-features = false, features = ["native-tls"], optional = true }
aws-sdk-cloudwatch = { git = "https://github.com/vectordotdev/aws-sdk-rust", rev = "3d6aefb7fcfced5fc2a7e761a87e4ddbda1ee670", default-features = false, features = ["native-tls"], optional = true }
aws-sdk-cloudwatchlogs = { git = "https://github.com/vectordotdev/aws-sdk-rust", rev = "3d6aefb7fcfced5fc2a7e761a87e4ddbda1ee670", default-features = false, features = ["native-tls"], optional = true }
aws-sdk-elasticsearch = { git = "https://github.com/vectordotdev/aws-sdk-rust", rev = "3d6aefb7fcfced5fc2a7e761a87e4ddbda1ee670", default-features = false, features = ["native-tls"], optional = true }
aws-sdk-firehose = { git = "https://github.com/vectordotdev/aws-sdk-rust", rev = "3d6aefb7fcfced5fc2a7e761a87e4ddbda1ee670", default-features = false, features = ["native-tls"], optional = true }
aws-sdk-kinesis = { git = "https://github.com/vectordotdev/aws-sdk-rust", rev = "3d6aefb7fcfced5fc2a7e761a87e4ddbda1ee670", default-features = false, features = ["native-tls"], optional = true }
aws-types = { git = "https://github.com/vectordotdev/aws-sdk-rust", rev = "3d6aefb7fcfced5fc2a7e761a87e4ddbda1ee670", default-features = false, optional = true }
aws-sigv4 = { git = "https://github.com/vectordotdev/aws-sdk-rust", rev = "3d6aefb7fcfced5fc2a7e761a87e4ddbda1ee670", default-features = false, features = ["sign-http"], optional = true }
aws-config = { git = "https://github.com/vectordotdev/aws-sdk-rust", rev = "3d6aefb7fcfced5fc2a7e761a87e4ddbda1ee670", default-features = false, features = ["native-tls"], optional = true }
aws-credential-types = { git = "https://github.com/vectordotdev/aws-sdk-rust", rev = "3d6aefb7fcfced5fc2a7e761a87e4ddbda1ee670", default-features = false, features = ["hardcoded-credentials"], optional = true }
aws-smithy-async = { git = "https://github.com/vectordotdev/aws-sdk-rust", rev = "3d6aefb7fcfced5fc2a7e761a87e4ddbda1ee670", default-features = false, optional = true }
aws-smithy-client = { git = "https://github.com/vectordotdev/aws-sdk-rust", rev = "3d6aefb7fcfced5fc2a7e761a87e4ddbda1ee670", default-features = false, features = ["client-hyper"], optional = true}
aws-smithy-http = { git = "https://github.com/vectordotdev/aws-sdk-rust", rev = "3d6aefb7fcfced5fc2a7e761a87e4ddbda1ee670", default-features = false, features = ["event-stream"], optional = true }
aws-smithy-http-tower = { git = "https://github.com/vectordotdev/aws-sdk-rust", rev = "3d6aefb7fcfced5fc2a7e761a87e4ddbda1ee670", default-features = false, optional = true }
aws-smithy-types = { git = "https://github.com/vectordotdev/aws-sdk-rust", rev = "3d6aefb7fcfced5fc2a7e761a87e4ddbda1ee670", default-features = false, optional = true }

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

aws-core = [
"aws-config",
"dep:aws-credential-types",
"dep:aws-sigv4",
"dep:aws-types",
"dep:aws-smithy-async",
Expand Down
12 changes: 11 additions & 1 deletion LICENSE-3rdparty.csv
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ arc-swap,https://github.com/vorner/arc-swap,MIT OR Apache-2.0,Michal 'vorner' Va
arr_macro,https://github.com/JoshMcguigan/arr_macro,MIT OR Apache-2.0,Josh Mcguigan
arrayvec,https://github.com/bluss/arrayvec,MIT OR Apache-2.0,bluss
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]>"
assert-json-diff,https://github.com/davidpdrsn/assert-json-diff,MIT,David Pedersen <[email protected]>
async-channel,https://github.com/smol-rs/async-channel,Apache-2.0 OR MIT,Stjepan Glavina <[email protected]>
async-compat,https://github.com/smol-rs/async-compat,Apache-2.0 OR MIT,Stjepan Glavina <[email protected]>
async-compression,https://github.com/Nemo157/async-compression,MIT OR Apache-2.0,"Wim Looman <[email protected]>, Allen Bui <[email protected]>"
Expand All @@ -38,6 +39,7 @@ async-trait,https://github.com/dtolnay/async-trait,MIT OR Apache-2.0,David Tolna
atomic-waker,https://github.com/stjepang/atomic-waker,Apache-2.0 OR MIT,Stjepan Glavina <[email protected]>
atty,https://github.com/softprops/atty,MIT,softprops <[email protected]>
aws-config,https://github.com/awslabs/smithy-rs,Apache-2.0,"AWS Rust SDK Team <[email protected]>, Russell Cohen <[email protected]>"
aws-credential-types,https://github.com/awslabs/smithy-rs,Apache-2.0,AWS Rust SDK Team <[email protected]>
aws-endpoint,https://github.com/awslabs/smithy-rs,Apache-2.0,"AWS Rust SDK Team <[email protected]>, Russell Cohen <[email protected]>"
aws-http,https://github.com/awslabs/smithy-rs,Apache-2.0,"AWS Rust SDK Team <[email protected]>, Russell Cohen <[email protected]>"
aws-sdk-cloudwatch,https://github.com/awslabs/aws-sdk-rust,Apache-2.0,"AWS Rust SDK Team <[email protected]>, Russell Cohen <[email protected]>"
Expand All @@ -57,6 +59,7 @@ aws-smithy-eventstream,https://github.com/awslabs/smithy-rs,Apache-2.0,"AWS Rust
aws-smithy-http,https://github.com/awslabs/smithy-rs,Apache-2.0,"AWS Rust SDK Team <[email protected]>, Russell Cohen <[email protected]>"
aws-smithy-http-tower,https://github.com/awslabs/smithy-rs,Apache-2.0,"AWS Rust SDK Team <[email protected]>, Russell Cohen <[email protected]>"
aws-smithy-json,https://github.com/awslabs/smithy-rs,Apache-2.0,"AWS Rust SDK Team <[email protected]>, John DiSanti <[email protected]>"
aws-smithy-protocol-test,https://github.com/awslabs/smithy-rs,Apache-2.0,"AWS Rust SDK Team <[email protected]>, Russell Cohen <[email protected]>"
aws-smithy-query,https://github.com/awslabs/smithy-rs,Apache-2.0,"AWS Rust SDK Team <[email protected]>, John DiSanti <[email protected]>"
aws-smithy-types,https://github.com/awslabs/smithy-rs,Apache-2.0,"AWS Rust SDK Team <[email protected]>, Russell Cohen <[email protected]>"
aws-smithy-xml,https://github.com/awslabs/smithy-rs,Apache-2.0,"AWS Rust SDK Team <[email protected]>, Russell Cohen <[email protected]>"
Expand Down Expand Up @@ -138,6 +141,7 @@ crossterm,https://github.com/crossterm-rs/crossterm,MIT,T. Post
crossterm_winapi,https://github.com/crossterm-rs/crossterm-winapi,MIT,T. Post
crypto-common,https://github.com/RustCrypto/traits,MIT OR Apache-2.0,RustCrypto Developers
csv,https://github.com/BurntSushi/rust-csv,Unlicense OR MIT,Andrew Gallant <[email protected]>
ctor,https://github.com/mmastrac/rust-ctor,Apache-2.0 OR MIT,Matt Mastracci <[email protected]>
ctr,https://github.com/RustCrypto/block-modes,MIT OR Apache-2.0,RustCrypto Developers
cty,https://github.com/japaric/cty,MIT OR Apache-2.0,Jorge Aparicio <[email protected]>
curve25519-dalek,https://github.com/dalek-cryptography/curve25519-dalek,BSD-3-Clause,"Isis Lovecruft <[email protected]>, Henry de Valence <[email protected]>"
Expand All @@ -151,6 +155,7 @@ der,https://github.com/RustCrypto/formats/tree/master/der,Apache-2.0 OR MIT,Rust
derivative,https://github.com/mcarton/rust-derivative,MIT OR Apache-2.0,mcarton <[email protected]>
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]>"
derive_more,https://github.com/JelteF/derive_more,MIT,Jelte Fennema <[email protected]>
diff,https://github.com/utkarshkukreti/diff.rs,MIT OR Apache-2.0,Utkarsh Kukreti <[email protected]>
digest,https://github.com/RustCrypto/traits,MIT OR Apache-2.0,RustCrypto Developers
dirs,https://github.com/soc/dirs-rs,MIT OR Apache-2.0,Simon Ochsenreither <[email protected]>
dirs-next,https://github.com/xdg-rs/dirs,MIT OR Apache-2.0,The @xdg-rs members
Expand All @@ -177,6 +182,7 @@ error-code,https://github.com/DoumanAsh/error-code,BSL-1.0,Douman <[email protected]
event-listener,https://github.com/smol-rs/event-listener,Apache-2.0 OR MIT,Stjepan Glavina <[email protected]>
executor-trait,https://github.com/amqp-rs/executor-trait,Apache-2.0 OR MIT,Marc-Antoine Perennou <[email protected]>
exitcode,https://github.com/benwilber/exitcode,Apache-2.0,Ben Wilber <[email protected]>
extend,https://github.com/davidpdrsn/ext,MIT,David Pedersen <[email protected]>
fakedata_generator,https://github.com/kevingimbel/fakedata_generator,MIT,Kevin Gimbel <[email protected]>
fallible-iterator,https://github.com/sfackler/rust-fallible-iterator,MIT OR Apache-2.0,Steven Fackler <[email protected]>
fastrand,https://github.com/smol-rs/fastrand,Apache-2.0 OR MIT,Stjepan Glavina <[email protected]>
Expand Down Expand Up @@ -351,6 +357,7 @@ openssl-macros,https://github.com/sfackler/rust-openssl,MIT OR Apache-2.0,The op
openssl-probe,https://github.com/alexcrichton/openssl-probe,MIT OR Apache-2.0,Alex Crichton <[email protected]>
openssl-sys,https://github.com/sfackler/rust-openssl,MIT,"Alex Crichton <[email protected]>, Steven Fackler <[email protected]>"
ordered-float,https://github.com/reem/rust-ordered-float,MIT,"Jonathan Reem <[email protected]>, Matt Brubeck <[email protected]>"
output_vt100,https://github.com/Phundrak/output-vt100-rs,MIT,Phuntsok Drak-pa <[email protected]>
outref,https://github.com/Nugine/outref,MIT,The outref Authors
overload,https://github.com/danaugrs/overload,MIT,Daniel Salvadori <[email protected]>
pad,https://github.com/ogham/rust-pad,MIT,Ben S <[email protected]>
Expand All @@ -376,6 +383,7 @@ postgres-openssl,https://github.com/sfackler/rust-postgres,MIT OR Apache-2.0,Ste
postgres-protocol,https://github.com/sfackler/rust-postgres,MIT OR Apache-2.0,Steven Fackler <[email protected]>
postgres-types,https://github.com/sfackler/rust-postgres,MIT OR Apache-2.0,Steven Fackler <[email protected]>
ppv-lite86,https://github.com/cryptocorrosion/cryptocorrosion,MIT OR Apache-2.0,The CryptoCorrosion Contributors
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]>"
prettydiff,https://github.com/romankoblov/prettydiff,MIT,Roman Koblov <[email protected]>
prettytable-rs,https://github.com/phsym/prettytable-rs,BSD-3-Clause,Pierre-Henri Symoneaux
proc-macro-crate,https://github.com/bkchr/proc-macro-crate,Apache-2.0 OR MIT,Bastian Köcher <[email protected]>
Expand Down Expand Up @@ -420,6 +428,7 @@ rmp,https://github.com/3Hren/msgpack-rust,MIT,Evgeny Safronov <division494@gmail
rmp-serde,https://github.com/3Hren/msgpack-rust,MIT,Evgeny Safronov <[email protected]>
rmpv,https://github.com/3Hren/msgpack-rust,MIT,Evgeny Safronov <[email protected]>
roaring,https://github.com/RoaringBitmap/roaring-rs,MIT OR Apache-2.0,"Wim Looman <[email protected]>, Kerollmops <[email protected]>"
roxmltree,https://github.com/RazrFalcon/roxmltree,MIT OR Apache-2.0,Evgeniy Reizner <[email protected]>
roxmltree,https://github.com/RazrFalcon/roxmltree,MIT OR Apache-2.0,Yevhenii Reizner <[email protected]>
rust_decimal,https://github.com/paupino/rust-decimal,MIT,Paul Mason <[email protected]>
rustc-hash,https://github.com/rust-lang-nursery/rustc-hash,Apache-2.0 OR MIT,The Rust Project Developers
Expand Down Expand Up @@ -473,6 +482,7 @@ signal-hook,https://github.com/vorner/signal-hook,Apache-2.0 OR MIT,"Michal 'vor
signal-hook-registry,https://github.com/vorner/signal-hook,Apache-2.0 OR MIT,"Michal 'vorner' Vaner <[email protected]>, Masaki Hara <[email protected]>"
signatory,https://github.com/iqlusioninc/crates/tree/main/signatory,Apache-2.0 OR MIT,Tony Arcieri <[email protected]>
signature,https://github.com/RustCrypto/traits/tree/master/signature,Apache-2.0 OR MIT,RustCrypto Developers
simd-abstraction,https://github.com/Nugine/simd,MIT,The simd-abstraction Authors
simpl,https://github.com/durch/simplerr,MIT,Drazen Urch <[email protected]>
siphasher,https://github.com/jedisct1/rust-siphash,MIT OR Apache-2.0,Frank Denis <[email protected]>
sketches-ddsketch,https://github.com/mheffner/rust-sketches-ddsketch,Apache-2.0,Mike Heffner <[email protected]>
Expand Down Expand Up @@ -571,7 +581,6 @@ valuable,https://github.com/tokio-rs/valuable,MIT,The valuable Authors
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 <>"
void,https://github.com/reem/rust-void,MIT,Jonathan Reem <[email protected]>
vrl,https://github.com/vectordotdev/vrl,MPL-2.0,Vector Contributors <[email protected]>
vsimd,https://github.com/Nugine/simd,MIT,The vsimd Authors
vte,https://github.com/alacritty/vte,Apache-2.0 OR MIT,"Joe Wilm <[email protected]>, Christian Duerr <[email protected]>"
vte_generate_state_changes,https://github.com/jwilm/vte,Apache-2.0 OR MIT,Christian Duerr <[email protected]>
wait-timeout,https://github.com/alexcrichton/wait-timeout,MIT OR Apache-2.0,Alex Crichton <[email protected]>
Expand Down Expand Up @@ -613,6 +622,7 @@ wyz,https://github.com/myrrlyn/wyz,MIT,myrrlyn <[email protected]>
xml-rs,https://github.com/kornelski/xml-rs,MIT,Vladimir Matveev <[email protected]>
xmlparser,https://github.com/RazrFalcon/xmlparser,MIT OR Apache-2.0,Evgeniy Reizner <[email protected]>
yaml-rust,https://github.com/chyh1990/yaml-rust,MIT OR Apache-2.0,Yuheng Chen <[email protected]>
yansi,https://github.com/SergioBenitez/yansi,MIT OR Apache-2.0,Sergio Benitez <[email protected]>
zerocopy,https://fuchsia.googlesource.com/fuchsia/+/HEAD/src/lib/zerocopy,BSD-2-Clause,Joshua Liebow-Feeser <[email protected]>
zerocopy-derive,https://github.com/google/zerocopy,BSD-2-Clause,Joshua Liebow-Feeser <[email protected]>
zeroize,https://github.com/RustCrypto/utils/tree/master/zeroize,Apache-2.0 OR MIT,The RustCrypto Project Developers
Expand Down
53 changes: 33 additions & 20 deletions src/aws/auth.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,10 @@ use aws_config::{
},
sts::AssumeRoleProviderBuilder,
};
use aws_types::{credentials::SharedCredentialsProvider, region::Region, Credentials};
use aws_credential_types::{
cache::CredentialsCache, provider::SharedCredentialsProvider, Credentials,
};
use aws_types::region::Region;
use serde_with::serde_as;
use vector_common::sensitive_string::SensitiveString;
use vector_config::configurable_component;
Expand Down Expand Up @@ -165,6 +168,28 @@ fn default_profile() -> String {
}

impl AwsAuthentication {
pub async fn credentials_cache(&self) -> crate::Result<CredentialsCache> {
match self {
AwsAuthentication::Role {
load_timeout_secs, ..
}
| AwsAuthentication::Default {
load_timeout_secs, ..
} => {
let credentials_cache = CredentialsCache::lazy_builder()
.load_timeout(
load_timeout_secs
.map(Duration::from_secs)
.unwrap_or(DEFAULT_LOAD_TIMEOUT),
)
.into_credentials_cache();

Ok(credentials_cache)
}
_ => Ok(CredentialsCache::lazy()),
}
}

pub async fn credentials_provider(
&self,
service_region: Region,
Expand Down Expand Up @@ -207,28 +232,20 @@ impl AwsAuthentication {
}
AwsAuthentication::Role {
assume_role,
load_timeout_secs,
imds,
region,
..
} => {
let auth_region = region.clone().map(Region::new).unwrap_or(service_region);
let provider = AssumeRoleProviderBuilder::new(assume_role)
.region(auth_region.clone())
.build(
default_credentials_provider(auth_region, *load_timeout_secs, *imds)
.await?,
);
.build(default_credentials_provider(auth_region, *imds).await?);

Ok(SharedCredentialsProvider::new(provider))
}
AwsAuthentication::Default {
load_timeout_secs,
imds,
region,
} => Ok(SharedCredentialsProvider::new(
AwsAuthentication::Default { imds, region, .. } => Ok(SharedCredentialsProvider::new(
default_credentials_provider(
region.clone().map(Region::new).unwrap_or(service_region),
*load_timeout_secs,
*imds,
)
.await?,
Expand All @@ -249,7 +266,6 @@ impl AwsAuthentication {

async fn default_credentials_provider(
region: Region,
load_timeout_secs: Option<u64>,
imds: ImdsAuthentication,
) -> crate::Result<SharedCredentialsProvider> {
let client = imds::Client::builder()
Expand All @@ -259,16 +275,13 @@ async fn default_credentials_provider(
.build()
.await?;

let chain = DefaultCredentialsChain::builder()
let credentials_provider = DefaultCredentialsChain::builder()
.region(region)
.imds_client(client)
.load_timeout(
load_timeout_secs
.map(Duration::from_secs)
.unwrap_or(DEFAULT_LOAD_TIMEOUT),
);
.build()
.await;

Ok(SharedCredentialsProvider::new(chain.build().await))
Ok(SharedCredentialsProvider::new(credentials_provider))
}

#[cfg(test)]
Expand Down
Loading

0 comments on commit 6a6b42b

Please sign in to comment.