Skip to content

Commit 2fc30e0

Browse files
committed
enable credentials-login feature for getting login from aws cli
1 parent 2a4e7ab commit 2fc30e0

5 files changed

Lines changed: 221 additions & 10 deletions

File tree

Cargo.lock

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

hydro_test/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ hydro_build_utils = { path = "../hydro_build_utils", version = "^0.0.1", optiona
4444

4545
aws-config = { version = "1", features = [
4646
"behavior-version-latest",
47+
"credentials-login",
4748
]}
4849
aws-sdk-sqs = { version = "1" }
4950
futures-util = { version = "0.3.0", default-features = false }

hydro_test/examples/aws_sqs.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,8 @@ use stageleft::q;
1313

1414
type HostCreator = Box<dyn Fn(&mut Deployment) -> Arc<dyn Host>>;
1515

16-
// cargo run -p hydro_test --example aws_sqs --all-features -- --queue-url=https://sqs.us-west-1.amazonaws.com/317211446276/hydro_test_queue
16+
// aws sqs send-message --queue-url 'https://sqs.us-west-1.amazonaws.com/557701608578/hydro_test_queue_standard' --message-body 'foobar'
17+
// cargo run -p hydro_test --example aws_sqs --all-features -- --queue-url 'https://sqs.us-west-1.amazonaws.com/557701608578/hydro_test_queue_standard'
1718
#[derive(Parser, Debug)]
1819
struct Args {
1920
#[clap(flatten)]

hydro_test/src/aws/mod.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,6 @@ where
3232
Loc: Location<'a> + NoTick + NoAtomic,
3333
{
3434
location
35-
.singleton(q!(aws_config::load_defaults(
36-
aws_config::BehaviorVersion::latest()
37-
)))
35+
.singleton(q!(aws_config::load_from_env()))
3836
.resolve_future_blocking()
3937
}

hydro_test/src/aws/sqs.rs

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,17 +30,19 @@ pub fn source_sqs_standard<'a, Loc: Location<'a>>(
3030
queue_url: &'a str,
3131
) -> Stream<Message, Loc, Bounded, NoOrder, AtLeastOnce> {
3232
client
33-
.flat_map_stream_unordered(q!(move |client| {
33+
.into_stream()
34+
.flat_map_stream_blocking(q!(move |client| {
3435
futures_util::stream::unfold((), move |()| {
3536
let fut = self::sqs_recv(&client, queue_url);
3637
async move {
37-
let vec = fut.await.expect("Failed to receive from SQS.")?;
38+
let vec = fut.await.expect("Failed to receive from SQS")?;
3839
Some((vec, ()))
3940
}
4041
})
4142
.flat_map(|vec| futures_util::stream::iter(vec))
4243
}))
4344
.weaken_retries()
45+
.weaken_ordering()
4446
}
4547

4648
/// Exactly-once in-order delivery from a FIFO SQS queue.
@@ -53,11 +55,12 @@ pub fn source_sqs_fifo<'a, Loc: Location<'a>>(
5355
_nondet: NonDet,
5456
) -> Stream<Message, Loc, Bounded, TotalOrder, ExactlyOnce> {
5557
client
56-
.flat_map_stream_ordered(q!(move |client| {
58+
.into_stream()
59+
.flat_map_stream_blocking(q!(move |client| {
5760
futures_util::stream::unfold((), move |()| {
5861
let fut = self::sqs_recv(&client, queue_url);
5962
async move {
60-
let vec = fut.await.expect("Failed to receive from SQS.")?;
63+
let vec = fut.await.expect("Failed to receive from SQS")?;
6164
Some((vec, ()))
6265
}
6366
})

0 commit comments

Comments
 (0)