From 9b5a66a86815ed8e36cc93ceef14d6c4d7f2df47 Mon Sep 17 00:00:00 2001 From: Nick Angelou Date: Mon, 20 Jan 2025 10:02:34 +0100 Subject: [PATCH 01/10] add copy/clone trait impl --- lambda-runtime/src/layers/otel.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/lambda-runtime/src/layers/otel.rs b/lambda-runtime/src/layers/otel.rs index f50f36f7..5598d745 100644 --- a/lambda-runtime/src/layers/otel.rs +++ b/lambda-runtime/src/layers/otel.rs @@ -8,6 +8,7 @@ use tracing::{field, instrument::Instrumented, Instrument}; /// Tower layer to add OpenTelemetry tracing to a Lambda function invocation. The layer accepts /// a function to flush OpenTelemetry after the end of the invocation. +#[derive(Copy, Clone)] pub struct OpenTelemetryLayer { flush_fn: F, otel_attribute_trigger: OpenTelemetryFaasTrigger, From 6931140113d3d79a4f892c45d4f686d9447300e0 Mon Sep 17 00:00:00 2001 From: Nick Angelou Date: Mon, 20 Jan 2025 12:36:21 +0100 Subject: [PATCH 02/10] update all deps and fix examples --- Cargo.toml | 10 +++--- .../Cargo.toml | 6 ++-- .../consumer/Cargo.toml | 6 ++-- .../pizza_lib/Cargo.toml | 2 +- .../producer/Cargo.toml | 10 +++--- .../Cargo.toml | 2 +- .../Cargo.toml | 4 +-- .../Cargo.toml | 2 +- examples/basic-error-handling/Cargo.toml | 6 ++-- examples/basic-error-thiserror/Cargo.toml | 2 +- .../basic-lambda-external-runtime/Cargo.toml | 10 +++--- examples/basic-lambda/Cargo.toml | 4 +-- .../Cargo.toml | 21 +++++------ .../src/main.rs | 9 +++-- .../src/s3.rs | 19 +++++----- examples/basic-s3-thumbnail/Cargo.toml | 14 ++++---- examples/basic-s3-thumbnail/src/main.rs | 6 ++-- examples/basic-s3-thumbnail/src/s3.rs | 4 +-- examples/basic-sdk/Cargo.toml | 10 +++--- examples/basic-sdk/src/main.rs | 7 ++-- examples/basic-shared-resource/Cargo.toml | 2 +- examples/basic-sqs/Cargo.toml | 2 +- examples/extension-basic/Cargo.toml | 2 +- examples/extension-combined/Cargo.toml | 2 +- examples/extension-custom-events/Cargo.toml | 2 +- examples/extension-custom-service/Cargo.toml | 2 +- examples/extension-internal-flush/Cargo.toml | 2 +- examples/extension-logs-basic/Cargo.toml | 2 +- .../extension-logs-custom-service/Cargo.toml | 2 +- .../Cargo.toml | 6 ++-- .../src/main.rs | 11 ++++-- examples/extension-telemetry-basic/Cargo.toml | 2 +- .../http-axum-apigw-authorizer/Cargo.toml | 2 +- examples/http-axum-diesel-ssl/Cargo.toml | 19 +++++----- examples/http-axum-diesel-ssl/src/main.rs | 35 +++++++++---------- examples/http-axum-diesel/Cargo.toml | 7 ++-- examples/http-axum-diesel/src/main.rs | 8 +++-- examples/http-axum/Cargo.toml | 2 +- examples/http-cors/Cargo.toml | 2 +- examples/http-dynamodb/Cargo.toml | 14 ++++---- examples/http-dynamodb/src/main.rs | 30 +++++++--------- examples/http-tower-trace/Cargo.toml | 4 +-- examples/lambda-rds-iam-auth/Cargo.toml | 14 ++++---- examples/opentelemetry-tracing/Cargo.toml | 10 +++--- lambda-events/Cargo.toml | 4 +-- lambda-extension/Cargo.toml | 4 +-- lambda-http/Cargo.toml | 12 +++---- lambda-integration-tests/Cargo.toml | 6 ++-- lambda-runtime-api-client/Cargo.toml | 2 +- lambda-runtime/Cargo.toml | 10 +++--- 50 files changed, 186 insertions(+), 190 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 867e9c0d..373eae1c 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -14,7 +14,7 @@ exclude = ["examples"] [workspace.dependencies] base64 = "0.22" bytes = "1" -chrono = { version = "0.4.35", default-features = false, features = [ +chrono = { version = "0.4.39", default-features = false, features = [ "clock", "serde", "std", @@ -22,12 +22,12 @@ chrono = { version = "0.4.35", default-features = false, features = [ futures = "0.3" futures-channel = "0.3" futures-util = "0.3" -http = "1.0" +http = "1.2" http-body = "1.0" http-body-util = "0.1" -http-serde = "2.0" -hyper = "1.0" -hyper-util = "0.1.1" +http-serde = "2.1" +hyper = "1.5" +hyper-util = "0.1.10" pin-project-lite = "0.2" tower = "0.5" tower-layer = "0.3" diff --git a/examples/advanced-appconfig-feature-flags/Cargo.toml b/examples/advanced-appconfig-feature-flags/Cargo.toml index 52ebb843..e19bd3ea 100644 --- a/examples/advanced-appconfig-feature-flags/Cargo.toml +++ b/examples/advanced-appconfig-feature-flags/Cargo.toml @@ -15,10 +15,10 @@ edition = "2021" # and it will keep the alphabetic ordering for you. [dependencies] -async-trait = "0.1.68" +async-trait = "0.1.85" lambda_runtime = "0.13" -reqwest = { version = "0.11", default-features = false, features = ["json", "rustls-tls"] } +reqwest = { version = "0.12", default-features = false, features = ["json", "rustls-tls"] } serde = { version = "1.0", features = ["derive"] } serde_json = "1.0" -thiserror = "1.0" +thiserror = "2.0" tokio = { version = "1", features = ["macros"] } diff --git a/examples/advanced-sqs-multiple-functions-shared-data/consumer/Cargo.toml b/examples/advanced-sqs-multiple-functions-shared-data/consumer/Cargo.toml index 69ec04a0..5a03daa6 100644 --- a/examples/advanced-sqs-multiple-functions-shared-data/consumer/Cargo.toml +++ b/examples/advanced-sqs-multiple-functions-shared-data/consumer/Cargo.toml @@ -5,9 +5,9 @@ edition = "2021" [dependencies] #aws dependencies -aws-sdk-config = "0.35.0" -aws-sdk-sqs = "0.35.0" -aws_lambda_events = { version = "0.11.1", features = ["sqs"], default-features = false } +aws-sdk-config = "1.57.0" +aws-sdk-sqs = "1.54.0" +aws_lambda_events = { version = "0.16.0", features = ["sqs"], default-features = false } #lambda runtime lambda_runtime = { path = "../../../lambda-runtime" } diff --git a/examples/advanced-sqs-multiple-functions-shared-data/pizza_lib/Cargo.toml b/examples/advanced-sqs-multiple-functions-shared-data/pizza_lib/Cargo.toml index 76631bbd..17486621 100644 --- a/examples/advanced-sqs-multiple-functions-shared-data/pizza_lib/Cargo.toml +++ b/examples/advanced-sqs-multiple-functions-shared-data/pizza_lib/Cargo.toml @@ -4,4 +4,4 @@ version = "0.1.0" edition = "2021" [dependencies] -serde = { version = "1.0.191", features = ["derive"] } +serde = { version = "1.0.217", features = ["derive"] } diff --git a/examples/advanced-sqs-multiple-functions-shared-data/producer/Cargo.toml b/examples/advanced-sqs-multiple-functions-shared-data/producer/Cargo.toml index 83aa48ab..8c2061db 100644 --- a/examples/advanced-sqs-multiple-functions-shared-data/producer/Cargo.toml +++ b/examples/advanced-sqs-multiple-functions-shared-data/producer/Cargo.toml @@ -8,14 +8,14 @@ env = { "QUEUE_URL" = "https://changeMe" } [dependencies] #aws dependencies -aws-config = "0.57.1" -aws-sdk-config = "0.35.0" -aws-sdk-sqs = "0.35.0" +aws-config = "1.5.14" +aws-sdk-config = "1.57.0" +aws-sdk-sqs = "1.54.0" #lambda runtime lambda_runtime = { path = "../../../lambda-runtime" } -serde_json = "1.0.108" +serde_json = "1.0.137" tokio = { version = "1", features = ["macros"] } #shared lib -pizza_lib = { path = "../pizza_lib" } \ No newline at end of file +pizza_lib = { path = "../pizza_lib" } diff --git a/examples/advanced-sqs-partial-batch-failures/Cargo.toml b/examples/advanced-sqs-partial-batch-failures/Cargo.toml index 95050b9a..5f89f606 100644 --- a/examples/advanced-sqs-partial-batch-failures/Cargo.toml +++ b/examples/advanced-sqs-partial-batch-failures/Cargo.toml @@ -6,7 +6,7 @@ edition = "2021" [dependencies] serde = "^1" serde_derive = "^1" -serde_with = { version = "^2", features = ["json"], optional = true } +serde_with = { version = "^3", features = ["json"], optional = true } serde_json = "^1" aws_lambda_events = { path = "../../lambda-events" } lambda_runtime = { path = "../../lambda-runtime" } diff --git a/examples/basic-cognito-post-confirmation/Cargo.toml b/examples/basic-cognito-post-confirmation/Cargo.toml index 7d2e7ab4..de6b8085 100644 --- a/examples/basic-cognito-post-confirmation/Cargo.toml +++ b/examples/basic-cognito-post-confirmation/Cargo.toml @@ -15,8 +15,8 @@ edition = "2021" # and it will keep the alphabetic ordering for you. [dependencies] -aws-config = "1.5.0" -aws-sdk-ses = "1.28.0" +aws-config = "1.5.14" +aws-sdk-ses = "1.57.0" aws_lambda_events = { path = "../../lambda-events", default-features = false, features = ["cognito"] } lambda_runtime = { path = "../../lambda-runtime" } diff --git a/examples/basic-error-error-crates-integration/Cargo.toml b/examples/basic-error-error-crates-integration/Cargo.toml index 741ec713..ccc62403 100644 --- a/examples/basic-error-error-crates-integration/Cargo.toml +++ b/examples/basic-error-error-crates-integration/Cargo.toml @@ -7,6 +7,6 @@ edition = "2021" anyhow = "1" eyre = "0.6.12" lambda_runtime = { path = "../../lambda-runtime", features = ["anyhow", "eyre", "miette"] } -miette = "7.2.0" +miette = "7.4.0" serde = "1" tokio = { version = "1", features = ["macros"] } diff --git a/examples/basic-error-handling/Cargo.toml b/examples/basic-error-handling/Cargo.toml index 1039a139..55da8395 100644 --- a/examples/basic-error-handling/Cargo.toml +++ b/examples/basic-error-handling/Cargo.toml @@ -5,7 +5,7 @@ edition = "2021" [dependencies] lambda_runtime = { path = "../../lambda-runtime" } -serde = "1.0.136" -serde_json = "1.0.81" -simple-error = "0.2.3" +serde = "1.0.217" +serde_json = "1.0.137" +simple-error = "0.3.1" tokio = { version = "1", features = ["macros"] } diff --git a/examples/basic-error-thiserror/Cargo.toml b/examples/basic-error-thiserror/Cargo.toml index d7c7d725..f2b0b449 100644 --- a/examples/basic-error-thiserror/Cargo.toml +++ b/examples/basic-error-thiserror/Cargo.toml @@ -18,5 +18,5 @@ edition = "2021" lambda_runtime = { path = "../../lambda-runtime" } serde = "1" -thiserror = "1.0.61" +thiserror = "2.0" tokio = { version = "1", features = ["macros"] } diff --git a/examples/basic-lambda-external-runtime/Cargo.toml b/examples/basic-lambda-external-runtime/Cargo.toml index d6d023d8..7a7af473 100644 --- a/examples/basic-lambda-external-runtime/Cargo.toml +++ b/examples/basic-lambda-external-runtime/Cargo.toml @@ -4,11 +4,11 @@ version = "0.1.0" edition = "2021" [dependencies] -async-channel = "1.8.0" -futures-lite = "1.13.0" +async-channel = "2.3.1" +futures-lite = "2.6.0" lambda_runtime = { path = "../../lambda-runtime" } -serde = "1.0.163" -tokio = "1.28.2" +serde = "1.0.217" +tokio = "1.43.0" [dev-dependencies] -tokio-test = "0.4.2" +tokio-test = "0.4.4" diff --git a/examples/basic-lambda/Cargo.toml b/examples/basic-lambda/Cargo.toml index 6fad6990..6e74e4ef 100644 --- a/examples/basic-lambda/Cargo.toml +++ b/examples/basic-lambda/Cargo.toml @@ -5,8 +5,8 @@ edition = "2021" [dependencies] lambda_runtime = { path = "../../lambda-runtime" } -serde = "1.0.136" +serde = "1.0.217" tokio = { version = "1", features = ["macros"] } [dev-dependencies] -tokio-test = "0.4.2" \ No newline at end of file +tokio-test = "0.4.4" diff --git a/examples/basic-s3-object-lambda-thumbnail/Cargo.toml b/examples/basic-s3-object-lambda-thumbnail/Cargo.toml index 905362c9..ad40a9e2 100644 --- a/examples/basic-s3-object-lambda-thumbnail/Cargo.toml +++ b/examples/basic-s3-object-lambda-thumbnail/Cargo.toml @@ -15,19 +15,20 @@ edition = "2021" # and it will keep the alphabetic ordering for you. [dependencies] -aws_lambda_events = "0.8.3" +aws_lambda_events = "0.16.0" lambda_runtime = { path = "../../lambda-runtime" } serde = "1" tokio = { version = "1", features = ["macros"] } -aws-config = "0.55.3" -aws-sdk-s3 = "0.28.0" +aws-config = "1.5.14" +aws-sdk-s3 = "1.69.0" thumbnailer = "0.5.1" -mime = "0.3.16" -async-trait = "0.1.66" -ureq = "2.6.2" -aws-smithy-http = "0.55.3" -webp = "=0.2.1" +mime = "0.3.17" +async-trait = "0.1.85" +ureq = "2.12.1" +aws-smithy-http = "0.60.12" +webp = "=0.3.0" [dev-dependencies] -mockall = "0.11.3" -tokio-test = "0.4.2" +serde_json = "1.0.137" +mockall = "0.13.1" +tokio-test = "0.4.4" diff --git a/examples/basic-s3-object-lambda-thumbnail/src/main.rs b/examples/basic-s3-object-lambda-thumbnail/src/main.rs index bb1c4f9c..90cfeec9 100644 --- a/examples/basic-s3-object-lambda-thumbnail/src/main.rs +++ b/examples/basic-s3-object-lambda-thumbnail/src/main.rs @@ -59,7 +59,7 @@ async fn main() -> Result<(), Error> { // required to enable CloudWatch error logging by the runtime tracing::init_default_subscriber(); - let shared_config = aws_config::load_from_env().await; + let shared_config = aws_config::from_env().load().await; let client = S3Client::new(&shared_config); let client_ref = &client; @@ -90,24 +90,23 @@ mod tests { use aws_lambda_events::s3::object_lambda::ListObjectsV2Context; use aws_lambda_events::s3::object_lambda::UserIdentity; use aws_lambda_events::s3::object_lambda::UserRequest; - use aws_lambda_events::serde_json::json; use lambda_runtime::{Context, LambdaEvent}; use mockall::mock; use s3::GetFile; use s3::SendFile; + use serde_json::json; #[tokio::test] async fn response_is_good() { mock! { FakeS3Client {} - #[async_trait] impl GetFile for FakeS3Client { - pub fn get_file(&self, url: String) -> Result, Box>; + fn get_file(&self, url: String) -> Result, Box>; } #[async_trait] impl SendFile for FakeS3Client { - pub async fn send_file(&self, route: String, token: String, vec: Vec) -> Result>; + async fn send_file(&self, route: String, token: String, vec: Vec) -> Result>; } } diff --git a/examples/basic-s3-object-lambda-thumbnail/src/s3.rs b/examples/basic-s3-object-lambda-thumbnail/src/s3.rs index daba3739..5248bbc0 100644 --- a/examples/basic-s3-object-lambda-thumbnail/src/s3.rs +++ b/examples/basic-s3-object-lambda-thumbnail/src/s3.rs @@ -1,6 +1,8 @@ use async_trait::async_trait; -use aws_sdk_s3::{operation::write_get_object_response::WriteGetObjectResponseError, Client as S3Client}; -use aws_smithy_http::{byte_stream::ByteStream, result::SdkError}; +use aws_sdk_s3::{ + error::SdkError, operation::write_get_object_response::WriteGetObjectResponseError, primitives::ByteStream, + Client as S3Client, +}; use lambda_runtime::tracing; use std::{error, io::Read}; @@ -46,9 +48,8 @@ impl SendFile for S3Client { .send() .await; - if write.is_err() { - let sdk_error = write.err().unwrap(); - check_error(sdk_error); + if let Err(err) = write { + check_error(err); Err("WriteGetObjectResponse creation error".into()) } else { Ok("File sent.".to_string()) @@ -65,16 +66,16 @@ fn check_error(error: SdkError) { tracing::info!("DispatchFailure"); if err.is_io() { tracing::info!("IO error"); - }; + } if err.is_timeout() { tracing::info!("Timeout error"); - }; + } if err.is_user() { tracing::info!("User error"); }; - if err.is_other().is_some() { + if err.is_other() { tracing::info!("Other error"); - }; + } } SdkError::ResponseError(_err) => tracing::info!("ResponseError"), SdkError::TimeoutError(_err) => tracing::info!("TimeoutError"), diff --git a/examples/basic-s3-thumbnail/Cargo.toml b/examples/basic-s3-thumbnail/Cargo.toml index 4b9ef3da..d2303fec 100644 --- a/examples/basic-s3-thumbnail/Cargo.toml +++ b/examples/basic-s3-thumbnail/Cargo.toml @@ -19,15 +19,15 @@ aws_lambda_events = { path = "../../lambda-events" } lambda_runtime = { path = "../../lambda-runtime" } serde = "1" tokio = { version = "1", features = ["macros"] } -aws-config = "0.55" -aws-smithy-http = "0.55.3" -aws-sdk-s3 = "0.28" +aws-config = "1.5.14" +aws-smithy-http = "0.60.12" +aws-sdk-s3 = "1.69.0" thumbnailer = "0.5.1" -mime = "0.3.16" -async-trait = "0.1.68" -webp = "=0.2.1" +mime = "0.3.17" +async-trait = "0.1.85" +webp = "=0.3.0" [dev-dependencies] -mockall = "0.11" +mockall = "0.13.1" tokio-test = "0.4" chrono = "0.4" diff --git a/examples/basic-s3-thumbnail/src/main.rs b/examples/basic-s3-thumbnail/src/main.rs index 3eb5bfe9..279a2b09 100644 --- a/examples/basic-s3-thumbnail/src/main.rs +++ b/examples/basic-s3-thumbnail/src/main.rs @@ -111,7 +111,7 @@ async fn main() -> Result<(), Error> { // required to enable CloudWatch error logging by the runtime tracing::init_default_subscriber(); - let shared_config = aws_config::load_from_env().await; + let shared_config = aws_config::from_env().load().await; let client = S3Client::new(&shared_config); let client_ref = &client; @@ -163,11 +163,11 @@ mod tests { #[async_trait] impl GetFile for FakeS3Client { - pub async fn get_file(&self, bucket: &str, key: &str) -> Result, GetObjectError>; + async fn get_file(&self, bucket: &str, key: &str) -> Result, GetObjectError>; } #[async_trait] impl PutFile for FakeS3Client { - pub async fn put_file(&self, bucket: &str, key: &str, bytes: Vec) -> Result; + async fn put_file(&self, bucket: &str, key: &str, bytes: Vec) -> Result; } } diff --git a/examples/basic-s3-thumbnail/src/s3.rs b/examples/basic-s3-thumbnail/src/s3.rs index 0dd8629d..a882a6ca 100644 --- a/examples/basic-s3-thumbnail/src/s3.rs +++ b/examples/basic-s3-thumbnail/src/s3.rs @@ -1,7 +1,5 @@ use async_trait::async_trait; -use aws_sdk_s3::operation::get_object::GetObjectError; -use aws_sdk_s3::Client as S3Client; -use aws_smithy_http::byte_stream::ByteStream; +use aws_sdk_s3::{error::SdkError, operation::get_object::GetObjectError, primitives::ByteStream, Client as S3Client}; use lambda_runtime::tracing; #[async_trait] diff --git a/examples/basic-sdk/Cargo.toml b/examples/basic-sdk/Cargo.toml index 454a970f..e9a0ee30 100644 --- a/examples/basic-sdk/Cargo.toml +++ b/examples/basic-sdk/Cargo.toml @@ -7,12 +7,12 @@ edition = "2021" [dependencies] async-trait = "0.1" -aws-config = "0.54" -aws-sdk-s3 = "0.24" +aws-config = "1.5.14" +aws-sdk-s3 = "1.69.0" lambda_runtime = { path = "../../lambda-runtime" } -serde = "1.0.136" +serde = "1.0.217" tokio = { version = "1", features = ["macros"] } [dev-dependencies] -mockall = "0.11.3" -tokio-test = "0.4.2" \ No newline at end of file +mockall = "0.13.1" +tokio-test = "0.4.4" diff --git a/examples/basic-sdk/src/main.rs b/examples/basic-sdk/src/main.rs index d49c84e1..e416728a 100644 --- a/examples/basic-sdk/src/main.rs +++ b/examples/basic-sdk/src/main.rs @@ -1,5 +1,5 @@ use async_trait::async_trait; -use aws_sdk_s3::{output::ListObjectsV2Output, Client as S3Client}; +use aws_sdk_s3::{operation::list_objects_v2::ListObjectsV2Output, Client as S3Client}; use lambda_runtime::{service_fn, tracing, Error, LambdaEvent}; use serde::{Deserialize, Serialize}; @@ -36,7 +36,7 @@ async fn main() -> Result<(), Error> { // required to enable CloudWatch error logging by the runtime tracing::init_default_subscriber(); - let shared_config = aws_config::load_from_env().await; + let shared_config = aws_config::from_env().load().await; let client = S3Client::new(&shared_config); let client_ref = &client; @@ -52,7 +52,6 @@ async fn my_handler(event: LambdaEvent, client: &T) -> let objects_rsp = client.list_objects(&bucket).await?; let objects: Vec<_> = objects_rsp .contents() - .ok_or("missing objects in list-objects-v2 response")? .into_iter() .filter_map(|o| o.key().map(|k| k.to_string())) .collect(); @@ -71,7 +70,7 @@ async fn my_handler(event: LambdaEvent, client: &T) -> #[cfg(test)] mod tests { use super::*; - use aws_sdk_s3::model::Object; + use aws_sdk_s3::types::Object; use lambda_runtime::{Context, LambdaEvent}; use mockall::predicate::eq; diff --git a/examples/basic-shared-resource/Cargo.toml b/examples/basic-shared-resource/Cargo.toml index 2aad5886..66285643 100644 --- a/examples/basic-shared-resource/Cargo.toml +++ b/examples/basic-shared-resource/Cargo.toml @@ -5,5 +5,5 @@ edition = "2021" [dependencies] lambda_runtime = { path = "../../lambda-runtime" } -serde = "1.0.136" +serde = "1.0.217" tokio = { version = "1", features = ["macros"] } diff --git a/examples/basic-sqs/Cargo.toml b/examples/basic-sqs/Cargo.toml index 0df7d8e2..26235957 100644 --- a/examples/basic-sqs/Cargo.toml +++ b/examples/basic-sqs/Cargo.toml @@ -17,5 +17,5 @@ edition = "2021" [dependencies] aws_lambda_events = { path = "../../lambda-events" } lambda_runtime = { path = "../../lambda-runtime" } -serde = "1.0.136" +serde = "1.0.217" tokio = { version = "1", features = ["macros"] } diff --git a/examples/extension-basic/Cargo.toml b/examples/extension-basic/Cargo.toml index 48e2ed51..6064b629 100644 --- a/examples/extension-basic/Cargo.toml +++ b/examples/extension-basic/Cargo.toml @@ -5,5 +5,5 @@ edition = "2021" [dependencies] lambda-extension = { path = "../../lambda-extension" } -serde = "1.0.136" +serde = "1.0.217" tokio = { version = "1", features = ["macros"] } diff --git a/examples/extension-combined/Cargo.toml b/examples/extension-combined/Cargo.toml index 2a745c7b..88fcf4e2 100644 --- a/examples/extension-combined/Cargo.toml +++ b/examples/extension-combined/Cargo.toml @@ -5,5 +5,5 @@ edition = "2021" [dependencies] lambda-extension = { path = "../../lambda-extension" } -serde = "1.0.136" +serde = "1.0.217" tokio = { version = "1", features = ["macros"] } diff --git a/examples/extension-custom-events/Cargo.toml b/examples/extension-custom-events/Cargo.toml index c2f813c3..0d9e0b9f 100644 --- a/examples/extension-custom-events/Cargo.toml +++ b/examples/extension-custom-events/Cargo.toml @@ -5,5 +5,5 @@ edition = "2021" [dependencies] lambda-extension = { path = "../../lambda-extension" } -serde = "1.0.136" +serde = "1.0.217" tokio = { version = "1", features = ["macros"] } diff --git a/examples/extension-custom-service/Cargo.toml b/examples/extension-custom-service/Cargo.toml index b51eae8e..a6f2ece0 100644 --- a/examples/extension-custom-service/Cargo.toml +++ b/examples/extension-custom-service/Cargo.toml @@ -5,5 +5,5 @@ edition = "2021" [dependencies] lambda-extension = { path = "../../lambda-extension" } -serde = "1.0.136" +serde = "1.0.217" tokio = { version = "1", features = ["macros"] } diff --git a/examples/extension-internal-flush/Cargo.toml b/examples/extension-internal-flush/Cargo.toml index daadd0eb..6b2cc2b6 100644 --- a/examples/extension-internal-flush/Cargo.toml +++ b/examples/extension-internal-flush/Cargo.toml @@ -8,5 +8,5 @@ anyhow = "1" aws_lambda_events = { path = "../../lambda-events" } lambda-extension = { path = "../../lambda-extension" } lambda_runtime = { path = "../../lambda-runtime" } -serde = "1.0.136" +serde = "1.0.217" tokio = { version = "1", features = ["macros", "sync"] } diff --git a/examples/extension-logs-basic/Cargo.toml b/examples/extension-logs-basic/Cargo.toml index dccc1ec0..a4723bf2 100644 --- a/examples/extension-logs-basic/Cargo.toml +++ b/examples/extension-logs-basic/Cargo.toml @@ -5,5 +5,5 @@ edition = "2021" [dependencies] lambda-extension = { path = "../../lambda-extension" } -serde = "1.0.136" +serde = "1.0.217" tokio = { version = "1", features = ["macros", "rt"] } diff --git a/examples/extension-logs-custom-service/Cargo.toml b/examples/extension-logs-custom-service/Cargo.toml index 1b1eea0a..718a9cb3 100644 --- a/examples/extension-logs-custom-service/Cargo.toml +++ b/examples/extension-logs-custom-service/Cargo.toml @@ -5,5 +5,5 @@ edition = "2021" [dependencies] lambda-extension = { path = "../../lambda-extension" } -serde = "1.0.136" +serde = "1.0.217" tokio = { version = "1", features = ["macros"] } diff --git a/examples/extension-logs-kinesis-firehose/Cargo.toml b/examples/extension-logs-kinesis-firehose/Cargo.toml index c6675e5a..1d37049b 100644 --- a/examples/extension-logs-kinesis-firehose/Cargo.toml +++ b/examples/extension-logs-kinesis-firehose/Cargo.toml @@ -5,6 +5,6 @@ edition = "2021" [dependencies] lambda-extension = { path = "../../lambda-extension" } -tokio = { version = "1.17.0", features = ["full"] } -aws-config = "0.13.0" -aws-sdk-firehose = "0.13.0" +tokio = { version = "1.43.0", features = ["full"] } +aws-config = "1.5.14" +aws-sdk-firehose = "1.60.0" diff --git a/examples/extension-logs-kinesis-firehose/src/main.rs b/examples/extension-logs-kinesis-firehose/src/main.rs index 7871ce52..e46c335a 100644 --- a/examples/extension-logs-kinesis-firehose/src/main.rs +++ b/examples/extension-logs-kinesis-firehose/src/main.rs @@ -1,4 +1,4 @@ -use aws_sdk_firehose::{model::Record, types::Blob, Client}; +use aws_sdk_firehose::{primitives::Blob, types::Record, Client}; use lambda_extension::{tracing, Error, Extension, LambdaLog, LambdaLogRecord, Service, SharedService}; use std::{future::Future, pin::Pin, task::Poll}; @@ -31,7 +31,12 @@ impl Service> for FirehoseLogsProcessor { for log in logs { match log.record { LambdaLogRecord::Function(record) => { - records.push(Record::builder().data(Blob::new(record.as_bytes())).build()) + match Record::builder().data(Blob::new(record.as_bytes())).build() { + Ok(rec) => records.push(rec), + Err(e) => { + return Box::pin(async move { Err(e.into()) }); + } + } } _ => unreachable!(), } @@ -56,7 +61,7 @@ async fn main() -> Result<(), Error> { // required to enable CloudWatch error logging by the runtime tracing::init_default_subscriber(); - let config = aws_config::load_from_env().await; + let config = aws_config::from_env().load().await; let logs_processor = SharedService::new(FirehoseLogsProcessor::new(Client::new(&config))); Extension::new() diff --git a/examples/extension-telemetry-basic/Cargo.toml b/examples/extension-telemetry-basic/Cargo.toml index 1b8b1ba4..ecf6991d 100644 --- a/examples/extension-telemetry-basic/Cargo.toml +++ b/examples/extension-telemetry-basic/Cargo.toml @@ -5,5 +5,5 @@ edition = "2021" [dependencies] lambda-extension = { path = "../../lambda-extension" } -serde = "1.0.136" +serde = "1.0.217" tokio = { version = "1", features = ["macros", "rt"] } diff --git a/examples/http-axum-apigw-authorizer/Cargo.toml b/examples/http-axum-apigw-authorizer/Cargo.toml index c757aa94..6d4a399c 100644 --- a/examples/http-axum-apigw-authorizer/Cargo.toml +++ b/examples/http-axum-apigw-authorizer/Cargo.toml @@ -7,6 +7,6 @@ edition = "2021" axum = "0.7" lambda_http = { path = "../../lambda-http" } lambda_runtime = { path = "../../lambda-runtime" } -serde = "1.0.196" +serde = "1.0.217" serde_json = "1.0" tokio = { version = "1", features = ["macros"] } diff --git a/examples/http-axum-diesel-ssl/Cargo.toml b/examples/http-axum-diesel-ssl/Cargo.toml index 69366957..7eaf1232 100755 --- a/examples/http-axum-diesel-ssl/Cargo.toml +++ b/examples/http-axum-diesel-ssl/Cargo.toml @@ -5,15 +5,14 @@ edition = "2021" [dependencies] axum = "0.7" -bb8 = "0.8.0" -diesel = "2.0.3" -diesel-async = { version = "0.2.1", features = ["postgres", "bb8"] } +diesel = "2.2.6" +diesel-async = { version = "0.5.2", features = ["postgres", "bb8"] } lambda_http = { path = "../../lambda-http" } lambda_runtime = { path = "../../lambda-runtime" } -serde = "1.0.159" -futures-util = "0.3.21" -rustls = "0.20.8" -rustls-native-certs = "0.6.2" -tokio = { version = "1.2.0", default-features = false, features = ["macros", "rt-multi-thread"] } -tokio-postgres = "0.7.7" -tokio-postgres-rustls = "0.9.0" \ No newline at end of file +serde = "1.0.217" +futures-util = "0.3.31" +rustls = "0.23.21" +rustls-native-certs = "0.8.1" +tokio = { version = "1.43.0", default-features = false, features = ["macros", "rt-multi-thread"] } +tokio-postgres = "0.7.12" +tokio-postgres-rustls = "0.13.0" diff --git a/examples/http-axum-diesel-ssl/src/main.rs b/examples/http-axum-diesel-ssl/src/main.rs index b340b44d..b71665a3 100755 --- a/examples/http-axum-diesel-ssl/src/main.rs +++ b/examples/http-axum-diesel-ssl/src/main.rs @@ -1,19 +1,20 @@ -use diesel::{ConnectionError, ConnectionResult}; -use futures_util::future::BoxFuture; -use futures_util::FutureExt; -use std::time::Duration; - use axum::{ extract::{Path, State}, response::Json, routing::get, Router, }; -use bb8::Pool; use diesel::prelude::*; -use diesel_async::{pooled_connection::AsyncDieselConnectionManager, AsyncPgConnection, RunQueryDsl}; +use diesel::{ConnectionError, ConnectionResult}; +use diesel_async::{ + pooled_connection::{bb8::Pool, AsyncDieselConnectionManager, ManagerConfig}, + AsyncPgConnection, RunQueryDsl, +}; +use futures_util::future::BoxFuture; +use futures_util::FutureExt; use lambda_http::{http::StatusCode, run, tracing, Error}; use serde::{Deserialize, Serialize}; +use std::time::Duration; table! { posts (id) { @@ -40,7 +41,7 @@ struct NewPost { published: bool, } -type AsyncPool = Pool>; +type AsyncPool = Pool; type ServerError = (StatusCode, String); async fn create_post(State(pool): State, Json(post): Json) -> Result, ServerError> { @@ -104,7 +105,10 @@ async fn main() -> Result<(), Error> { // Format for DATABASE_URL=postgres://your_username:your_password@your_host:5432/your_db?sslmode=require let db_url = std::env::var("DATABASE_URL").expect("Env var `DATABASE_URL` not set"); - let mgr = AsyncDieselConnectionManager::::new_with_setup(db_url, establish_connection); + let mut config = ManagerConfig::default(); + config.custom_setup = Box::new(establish_connection); + + let mgr = AsyncDieselConnectionManager::::new_with_config(db_url, config); let pool = Pool::builder() .max_size(10) @@ -129,19 +133,15 @@ fn establish_connection(config: &str) -> BoxFuture BoxFuture rustls::RootCertStore { let mut roots = rustls::RootCertStore::empty(); let certs = rustls_native_certs::load_native_certs().expect("Certs not loadable!"); - let certs: Vec<_> = certs.into_iter().map(|cert| cert.0).collect(); - roots.add_parsable_certificates(&certs); + roots.add_parsable_certificates(certs); roots } diff --git a/examples/http-axum-diesel/Cargo.toml b/examples/http-axum-diesel/Cargo.toml index 39fc813e..eefe6afd 100644 --- a/examples/http-axum-diesel/Cargo.toml +++ b/examples/http-axum-diesel/Cargo.toml @@ -5,10 +5,9 @@ edition = "2021" [dependencies] axum = "0.7" -bb8 = "0.8.0" -diesel = "2.0.3" -diesel-async = { version = "0.2.1", features = ["postgres", "bb8"] } +diesel = "2.2.6" +diesel-async = { version = "0.5.2", features = ["postgres", "bb8"] } lambda_http = { path = "../../lambda-http" } lambda_runtime = { path = "../../lambda-runtime" } -serde = "1.0.159" +serde = "1.0.217" tokio = { version = "1", features = ["macros"] } diff --git a/examples/http-axum-diesel/src/main.rs b/examples/http-axum-diesel/src/main.rs index b7247be4..348d7535 100644 --- a/examples/http-axum-diesel/src/main.rs +++ b/examples/http-axum-diesel/src/main.rs @@ -4,9 +4,11 @@ use axum::{ routing::get, Router, }; -use bb8::Pool; use diesel::prelude::*; -use diesel_async::{pooled_connection::AsyncDieselConnectionManager, AsyncPgConnection, RunQueryDsl}; +use diesel_async::{ + pooled_connection::{bb8::Pool, AsyncDieselConnectionManager}, + AsyncPgConnection, RunQueryDsl, +}; use lambda_http::{http::StatusCode, run, tracing, Error}; use serde::{Deserialize, Serialize}; @@ -35,7 +37,7 @@ struct NewPost { published: bool, } -type AsyncPool = Pool>; +type AsyncPool = Pool; type ServerError = (StatusCode, String); async fn create_post(State(pool): State, Json(post): Json) -> Result, ServerError> { diff --git a/examples/http-axum/Cargo.toml b/examples/http-axum/Cargo.toml index 7ab3c0ec..0733d46a 100644 --- a/examples/http-axum/Cargo.toml +++ b/examples/http-axum/Cargo.toml @@ -7,6 +7,6 @@ edition = "2021" axum = "0.7" lambda_http = { path = "../../lambda-http" } lambda_runtime = { path = "../../lambda-runtime" } -serde = "1.0.196" +serde = "1.0.217" serde_json = "1.0" tokio = { version = "1", features = ["macros"] } diff --git a/examples/http-cors/Cargo.toml b/examples/http-cors/Cargo.toml index b8e51031..e7eeefc6 100644 --- a/examples/http-cors/Cargo.toml +++ b/examples/http-cors/Cargo.toml @@ -7,4 +7,4 @@ edition = "2021" lambda_http = { path = "../../lambda-http" } lambda_runtime = { path = "../../lambda-runtime" } tokio = { version = "1", features = ["macros"] } -tower-http = { version = "0.5", features = ["cors"] } +tower-http = { version = "0.6", features = ["cors"] } diff --git a/examples/http-dynamodb/Cargo.toml b/examples/http-dynamodb/Cargo.toml index f2b8db98..62bd9225 100644 --- a/examples/http-dynamodb/Cargo.toml +++ b/examples/http-dynamodb/Cargo.toml @@ -4,11 +4,11 @@ version = "0.1.0" edition = "2021" [dependencies] -simple-error = "0.3.0" -serde_json = "1.0.107" -serde = { version = "1.0.189", features = ["derive"] } -serde_dynamo = {version = "^4.2.7", features = ["aws-sdk-dynamodb+0_33"]} +simple-error = "0.3.1" +serde_json = "1.0.137" +serde = { version = "1.0.217", features = ["derive"] } +serde_dynamo = { version = "4.2.14", features = ["aws-sdk-dynamodb+1"] } lambda_http = { path = "../../lambda-http" } -aws-sdk-dynamodb = "0.33.0" -aws-config = "0.56.1" -tokio = { version = "1.33.0", features = ["macros"] } +aws-sdk-dynamodb = "1.60.0" +aws-config = "1.5.14" +tokio = { version = "1.43.0", features = ["macros"] } diff --git a/examples/http-dynamodb/src/main.rs b/examples/http-dynamodb/src/main.rs index e5cbb2a3..eb3d450f 100644 --- a/examples/http-dynamodb/src/main.rs +++ b/examples/http-dynamodb/src/main.rs @@ -1,15 +1,15 @@ use aws_sdk_dynamodb::Client; use lambda_http::{run, service_fn, tracing, Body, Error, Request, Response}; use serde::{Deserialize, Serialize}; -use serde_dynamo::to_attribute_value; +use serde_dynamo::to_item; #[derive(Clone, Debug, Serialize, Deserialize)] pub struct Item { - pub p_type: String, + pub account_type: String, pub age: String, pub username: String, - pub first: String, - pub last: String, + pub first_name: String, + pub last_name: String, } /// This is the main body for the function. @@ -58,7 +58,7 @@ async fn main() -> Result<(), Error> { tracing::init_default_subscriber(); //Get config from environment. - let config = aws_config::load_from_env().await; + let config = aws_config::from_env().load().await; //Create the DynamoDB client. let client = Client::new(&config); @@ -71,20 +71,14 @@ async fn main() -> Result<(), Error> { // Add an item to a table. // snippet-start:[dynamodb.rust.add-item] pub async fn add_item(client: &Client, item: Item, table: &str) -> Result<(), Error> { - let user_av = to_attribute_value(item.username)?; - let type_av = to_attribute_value(item.p_type)?; - let age_av = to_attribute_value(item.age)?; - let first_av = to_attribute_value(item.first)?; - let last_av = to_attribute_value(item.last)?; + let item = to_item(item)?; - let request = client - .put_item() - .table_name(table) - .item("username", user_av) - .item("account_type", type_av) - .item("age", age_av) - .item("first_name", first_av) - .item("last_name", last_av); + let request = client.put_item().table_name(table).set_item(Some(item)); + // .item("username", user_av) + // .item("account_type", type_av) + // .item("age", age_av) + // .item("first_name", first_av) + // .item("last_name", last_av); tracing::info!("adding item to DynamoDB"); diff --git a/examples/http-tower-trace/Cargo.toml b/examples/http-tower-trace/Cargo.toml index 36389f0e..dc3b6802 100644 --- a/examples/http-tower-trace/Cargo.toml +++ b/examples/http-tower-trace/Cargo.toml @@ -5,6 +5,6 @@ edition = "2021" [dependencies] lambda_http = { path = "../../lambda-http" } -lambda_runtime = "0.5.1" +lambda_runtime = "0.13.0" tokio = { version = "1", features = ["macros"] } -tower-http = { version = "0.5", features = ["trace"] } +tower-http = { version = "0.6", features = ["trace"] } diff --git a/examples/lambda-rds-iam-auth/Cargo.toml b/examples/lambda-rds-iam-auth/Cargo.toml index a1e212ae..1b869fd7 100644 --- a/examples/lambda-rds-iam-auth/Cargo.toml +++ b/examples/lambda-rds-iam-auth/Cargo.toml @@ -5,10 +5,10 @@ edition = "2021" [dependencies] lambda_runtime = { path = "../../lambda-runtime" } -serde_json = "1.0.120" -aws-config = "1.0.1" -aws-credential-types = "1.0.1" -aws-sigv4 = "1.0.1" -url = "2.5.0" -tokio = { version = "1.25.0", features = ["full"] } -sqlx = { version = "0.7.4", features = ["tls-rustls", "postgres", "runtime-tokio"] } +serde_json = "1.0.137" +aws-config = "1.5.14" +aws-credential-types = "1.2.1" +aws-sigv4 = "1.2.7" +url = "2.5.4" +tokio = { version = "1.43.0", features = ["full"] } +sqlx = { version = "0.8.3", features = ["tls-rustls", "postgres", "runtime-tokio"] } diff --git a/examples/opentelemetry-tracing/Cargo.toml b/examples/opentelemetry-tracing/Cargo.toml index 98108d39..18e5926c 100644 --- a/examples/opentelemetry-tracing/Cargo.toml +++ b/examples/opentelemetry-tracing/Cargo.toml @@ -5,14 +5,14 @@ edition = "2021" [dependencies] lambda_runtime = { path = "../../lambda-runtime", features = ["opentelemetry"] } -opentelemetry-semantic-conventions = "0.14" -opentelemetry = "0.22" -opentelemetry_sdk = { version = "0.22", features = ["rt-tokio"] } -opentelemetry-stdout = { version = "0.3", features = ["trace"] } +opentelemetry-semantic-conventions = "0.27" +opentelemetry = "0.27" +opentelemetry_sdk = { version = "0.27", features = ["rt-tokio"] } +opentelemetry-stdout = { version = "0.27", features = ["trace"] } pin-project = "1" serde_json = "1.0" tokio = "1" tower = "0.5" tracing = "0.1" -tracing-opentelemetry = "0.23" +tracing-opentelemetry = "0.28" tracing-subscriber = "0.3" diff --git a/lambda-events/Cargo.toml b/lambda-events/Cargo.toml index b8d34055..3b5b7ba0 100644 --- a/lambda-events/Cargo.toml +++ b/lambda-events/Cargo.toml @@ -19,7 +19,7 @@ edition = "2021" base64 = { workspace = true } bytes = { workspace = true, features = ["serde"], optional = true } chrono = { workspace = true, optional = true } -flate2 = { version = "1.0.24", optional = true } +flate2 = { version = "1.0.35", optional = true } http = { workspace = true, optional = true } http-body = { workspace = true, optional = true } http-serde = { workspace = true, optional = true } @@ -30,7 +30,7 @@ query_map = { version = "^0.7", features = [ serde = { version = "^1", features = ["derive"] } serde_with = { version = "^3", features = ["json"], optional = true } serde_json = "^1" -serde_dynamo = { version = "^4.1", optional = true } +serde_dynamo = { version = "^4.2", optional = true } [features] default = [ diff --git a/lambda-extension/Cargo.toml b/lambda-extension/Cargo.toml index 16b6dace..dc1834cd 100644 --- a/lambda-extension/Cargo.toml +++ b/lambda-extension/Cargo.toml @@ -28,12 +28,12 @@ hyper-util = { workspace = true } lambda_runtime_api_client = { version = "0.11", path = "../lambda-runtime-api-client" } serde = { version = "1", features = ["derive"] } serde_json = "^1" -tokio = { version = "1.0", features = [ +tokio = { version = "1.43", features = [ "macros", "io-util", "sync", "rt-multi-thread", ] } -tokio-stream = "0.1.2" +tokio-stream = "0.1.17" tower = { workspace = true, features = ["make", "util"] } tracing = { version = "0.1", features = ["log"] } diff --git a/lambda-http/Cargo.toml b/lambda-http/Cargo.toml index 46198dca..81e9c047 100644 --- a/lambda-http/Cargo.toml +++ b/lambda-http/Cargo.toml @@ -40,13 +40,13 @@ http-body-util = { workspace = true } hyper = { workspace = true } lambda_runtime = { version = "0.13.0", path = "../lambda-runtime" } mime = "0.3" -percent-encoding = "2.2" +percent-encoding = "2.3" pin-project-lite = { workspace = true } serde = { version = "1.0", features = ["derive"] } serde_json = { version = "1.0", features = ["raw_value"] } serde_urlencoded = "0.7" -tokio-stream = "0.1.2" -url = "2.2" +tokio-stream = "0.1.17" +url = "2.5" [dependencies.aws_lambda_events] path = "../lambda-events" @@ -55,9 +55,9 @@ default-features = false features = ["alb", "apigw"] [dev-dependencies] -axum-core = "0.4.3" -axum-extra = { version = "0.9.2", features = ["query"] } +axum-core = "0.4.5" +axum-extra = { version = "0.9.6", features = ["query"] } lambda_runtime_api_client = { version = "0.11.1", path = "../lambda-runtime-api-client" } log = "^0.4" maplit = "1.0" -tokio = { version = "1.0", features = ["macros"] } +tokio = { version = "1.43", features = ["macros"] } diff --git a/lambda-integration-tests/Cargo.toml b/lambda-integration-tests/Cargo.toml index ee44a969..dc6813b5 100644 --- a/lambda-integration-tests/Cargo.toml +++ b/lambda-integration-tests/Cargo.toml @@ -13,12 +13,12 @@ readme = "../README.md" [dependencies] lambda_runtime = { path = "../lambda-runtime" } aws_lambda_events = { path = "../lambda-events" } -serde_json = "1.0.121" +serde_json = "1.0.137" tokio = { version = "1", features = ["full"] } -serde = { version = "1.0.204", features = ["derive"] } +serde = { version = "1.0.217", features = ["derive"] } [dev-dependencies] -reqwest = { version = "0.12.5", features = ["blocking"] } +reqwest = { version = "0.12.12", features = ["blocking"] } openssl = { version = "0.10", features = ["vendored"] } [[bin]] diff --git a/lambda-runtime-api-client/Cargo.toml b/lambda-runtime-api-client/Cargo.toml index 57fc4bca..03c155a3 100644 --- a/lambda-runtime-api-client/Cargo.toml +++ b/lambda-runtime-api-client/Cargo.toml @@ -33,6 +33,6 @@ hyper-util = { workspace = true, features = [ ] } tower = { workspace = true, features = ["util"] } tower-service = { workspace = true } -tokio = { version = "1.0", features = ["io-util"] } +tokio = { version = "1.43", features = ["io-util"] } tracing = { version = "0.1", features = ["log"], optional = true } tracing-subscriber = { version = "0.3", default-features = false, features = ["fmt", "json", "env-filter"], optional = true } diff --git a/lambda-runtime/Cargo.toml b/lambda-runtime/Cargo.toml index b4a7ad3d..48549777 100644 --- a/lambda-runtime/Cargo.toml +++ b/lambda-runtime/Cargo.toml @@ -22,7 +22,7 @@ eyre = ["dep:eyre"] # enables From for Diagnostic for eyre error types, see R miette = ["dep:miette"] # enables From for Diagnostic for miette error types, see README.md for more info [dependencies] -anyhow = { version = "1.0.86", optional = true } +anyhow = { version = "1.0.95", optional = true } async-stream = "0.3" base64 = { workspace = true } bytes = { workspace = true } @@ -40,19 +40,19 @@ hyper-util = { workspace = true, features = [ "tokio", ] } lambda_runtime_api_client = { version = "0.11.1", path = "../lambda-runtime-api-client", default-features = false } -miette = { version = "7.2.0", optional = true } +miette = { version = "7.4.0", optional = true } opentelemetry-semantic-conventions = { version = "0.27", optional = true, features = ["semconv_experimental"] } pin-project = "1" serde = { version = "1", features = ["derive", "rc"] } serde_json = "^1" -serde_path_to_error = "0.1.11" -tokio = { version = "1.0", features = [ +serde_path_to_error = "0.1.16" +tokio = { version = "1.43", features = [ "macros", "io-util", "sync", "rt-multi-thread", ] } -tokio-stream = "0.1.2" +tokio-stream = "0.1.17" tower = { workspace = true, features = ["util"] } tower-layer = { workspace = true } tracing = { version = "0.1", features = ["log"] } From 31d111601ce27ad79d9ed52916889232176adb40 Mon Sep 17 00:00:00 2001 From: Nick Angelou Date: Mon, 20 Jan 2025 13:11:14 +0100 Subject: [PATCH 03/10] remove unused deps --- .../consumer/Cargo.toml | 2 -- .../producer/Cargo.toml | 1 - .../Cargo.toml | 2 -- .../basic-lambda-external-runtime/Cargo.toml | 3 --- examples/basic-lambda/Cargo.toml | 3 --- .../basic-s3-object-lambda-thumbnail/Cargo.toml | 4 ---- examples/basic-s3-thumbnail/Cargo.toml | 4 ---- examples/basic-s3-thumbnail/src/s3.rs | 2 +- examples/basic-sdk/Cargo.toml | 1 - examples/extension-basic/Cargo.toml | 1 - examples/extension-combined/Cargo.toml | 1 - examples/extension-custom-events/Cargo.toml | 1 - examples/extension-custom-service/Cargo.toml | 1 - examples/extension-logs-basic/Cargo.toml | 1 - .../extension-logs-custom-service/Cargo.toml | 1 - examples/extension-telemetry-basic/Cargo.toml | 1 - examples/http-axum-apigw-authorizer/Cargo.toml | 2 -- examples/http-axum-diesel-ssl/Cargo.toml | 1 - examples/http-axum-diesel/Cargo.toml | 1 - examples/http-axum-middleware/Cargo.toml | 1 - examples/http-axum/Cargo.toml | 1 - examples/http-basic-lambda/Cargo.toml | 1 - examples/http-cors/Cargo.toml | 1 - examples/http-dynamodb/Cargo.toml | 1 - examples/http-query-parameters/Cargo.toml | 1 - examples/http-raw-path/Cargo.toml | 1 - examples/http-shared-resource/Cargo.toml | 1 - examples/http-tower-trace/Cargo.toml | 1 - examples/opentelemetry-tracing/Cargo.toml | 2 -- lambda-extension/Cargo.toml | 1 - lambda-http/Cargo.toml | 4 ---- lambda-integration-tests/Cargo.toml | 1 - lambda-runtime-api-client/Cargo.toml | 4 ++-- lambda-runtime/Cargo.toml | 17 ----------------- 34 files changed, 3 insertions(+), 68 deletions(-) diff --git a/examples/advanced-sqs-multiple-functions-shared-data/consumer/Cargo.toml b/examples/advanced-sqs-multiple-functions-shared-data/consumer/Cargo.toml index 5a03daa6..31129b94 100644 --- a/examples/advanced-sqs-multiple-functions-shared-data/consumer/Cargo.toml +++ b/examples/advanced-sqs-multiple-functions-shared-data/consumer/Cargo.toml @@ -5,8 +5,6 @@ edition = "2021" [dependencies] #aws dependencies -aws-sdk-config = "1.57.0" -aws-sdk-sqs = "1.54.0" aws_lambda_events = { version = "0.16.0", features = ["sqs"], default-features = false } #lambda runtime diff --git a/examples/advanced-sqs-multiple-functions-shared-data/producer/Cargo.toml b/examples/advanced-sqs-multiple-functions-shared-data/producer/Cargo.toml index 8c2061db..4797c807 100644 --- a/examples/advanced-sqs-multiple-functions-shared-data/producer/Cargo.toml +++ b/examples/advanced-sqs-multiple-functions-shared-data/producer/Cargo.toml @@ -9,7 +9,6 @@ env = { "QUEUE_URL" = "https://changeMe" } [dependencies] #aws dependencies aws-config = "1.5.14" -aws-sdk-config = "1.57.0" aws-sdk-sqs = "1.54.0" #lambda runtime diff --git a/examples/advanced-sqs-partial-batch-failures/Cargo.toml b/examples/advanced-sqs-partial-batch-failures/Cargo.toml index 5f89f606..f02e4efb 100644 --- a/examples/advanced-sqs-partial-batch-failures/Cargo.toml +++ b/examples/advanced-sqs-partial-batch-failures/Cargo.toml @@ -5,8 +5,6 @@ edition = "2021" [dependencies] serde = "^1" -serde_derive = "^1" -serde_with = { version = "^3", features = ["json"], optional = true } serde_json = "^1" aws_lambda_events = { path = "../../lambda-events" } lambda_runtime = { path = "../../lambda-runtime" } diff --git a/examples/basic-lambda-external-runtime/Cargo.toml b/examples/basic-lambda-external-runtime/Cargo.toml index 7a7af473..6b0137f8 100644 --- a/examples/basic-lambda-external-runtime/Cargo.toml +++ b/examples/basic-lambda-external-runtime/Cargo.toml @@ -9,6 +9,3 @@ futures-lite = "2.6.0" lambda_runtime = { path = "../../lambda-runtime" } serde = "1.0.217" tokio = "1.43.0" - -[dev-dependencies] -tokio-test = "0.4.4" diff --git a/examples/basic-lambda/Cargo.toml b/examples/basic-lambda/Cargo.toml index 6e74e4ef..265c3033 100644 --- a/examples/basic-lambda/Cargo.toml +++ b/examples/basic-lambda/Cargo.toml @@ -7,6 +7,3 @@ edition = "2021" lambda_runtime = { path = "../../lambda-runtime" } serde = "1.0.217" tokio = { version = "1", features = ["macros"] } - -[dev-dependencies] -tokio-test = "0.4.4" diff --git a/examples/basic-s3-object-lambda-thumbnail/Cargo.toml b/examples/basic-s3-object-lambda-thumbnail/Cargo.toml index ad40a9e2..ef9fc75e 100644 --- a/examples/basic-s3-object-lambda-thumbnail/Cargo.toml +++ b/examples/basic-s3-object-lambda-thumbnail/Cargo.toml @@ -17,7 +17,6 @@ edition = "2021" [dependencies] aws_lambda_events = "0.16.0" lambda_runtime = { path = "../../lambda-runtime" } -serde = "1" tokio = { version = "1", features = ["macros"] } aws-config = "1.5.14" aws-sdk-s3 = "1.69.0" @@ -25,10 +24,7 @@ thumbnailer = "0.5.1" mime = "0.3.17" async-trait = "0.1.85" ureq = "2.12.1" -aws-smithy-http = "0.60.12" -webp = "=0.3.0" [dev-dependencies] serde_json = "1.0.137" mockall = "0.13.1" -tokio-test = "0.4.4" diff --git a/examples/basic-s3-thumbnail/Cargo.toml b/examples/basic-s3-thumbnail/Cargo.toml index d2303fec..a3cb36dc 100644 --- a/examples/basic-s3-thumbnail/Cargo.toml +++ b/examples/basic-s3-thumbnail/Cargo.toml @@ -17,17 +17,13 @@ edition = "2021" [dependencies] aws_lambda_events = { path = "../../lambda-events" } lambda_runtime = { path = "../../lambda-runtime" } -serde = "1" tokio = { version = "1", features = ["macros"] } aws-config = "1.5.14" -aws-smithy-http = "0.60.12" aws-sdk-s3 = "1.69.0" thumbnailer = "0.5.1" mime = "0.3.17" async-trait = "0.1.85" -webp = "=0.3.0" [dev-dependencies] mockall = "0.13.1" -tokio-test = "0.4" chrono = "0.4" diff --git a/examples/basic-s3-thumbnail/src/s3.rs b/examples/basic-s3-thumbnail/src/s3.rs index a882a6ca..b8f8efa0 100644 --- a/examples/basic-s3-thumbnail/src/s3.rs +++ b/examples/basic-s3-thumbnail/src/s3.rs @@ -1,5 +1,5 @@ use async_trait::async_trait; -use aws_sdk_s3::{error::SdkError, operation::get_object::GetObjectError, primitives::ByteStream, Client as S3Client}; +use aws_sdk_s3::{operation::get_object::GetObjectError, primitives::ByteStream, Client as S3Client}; use lambda_runtime::tracing; #[async_trait] diff --git a/examples/basic-sdk/Cargo.toml b/examples/basic-sdk/Cargo.toml index e9a0ee30..c99739f9 100644 --- a/examples/basic-sdk/Cargo.toml +++ b/examples/basic-sdk/Cargo.toml @@ -15,4 +15,3 @@ tokio = { version = "1", features = ["macros"] } [dev-dependencies] mockall = "0.13.1" -tokio-test = "0.4.4" diff --git a/examples/extension-basic/Cargo.toml b/examples/extension-basic/Cargo.toml index 6064b629..d7cf1f13 100644 --- a/examples/extension-basic/Cargo.toml +++ b/examples/extension-basic/Cargo.toml @@ -5,5 +5,4 @@ edition = "2021" [dependencies] lambda-extension = { path = "../../lambda-extension" } -serde = "1.0.217" tokio = { version = "1", features = ["macros"] } diff --git a/examples/extension-combined/Cargo.toml b/examples/extension-combined/Cargo.toml index 88fcf4e2..93aacca1 100644 --- a/examples/extension-combined/Cargo.toml +++ b/examples/extension-combined/Cargo.toml @@ -5,5 +5,4 @@ edition = "2021" [dependencies] lambda-extension = { path = "../../lambda-extension" } -serde = "1.0.217" tokio = { version = "1", features = ["macros"] } diff --git a/examples/extension-custom-events/Cargo.toml b/examples/extension-custom-events/Cargo.toml index 0d9e0b9f..dfef4c4b 100644 --- a/examples/extension-custom-events/Cargo.toml +++ b/examples/extension-custom-events/Cargo.toml @@ -5,5 +5,4 @@ edition = "2021" [dependencies] lambda-extension = { path = "../../lambda-extension" } -serde = "1.0.217" tokio = { version = "1", features = ["macros"] } diff --git a/examples/extension-custom-service/Cargo.toml b/examples/extension-custom-service/Cargo.toml index a6f2ece0..8d0e4575 100644 --- a/examples/extension-custom-service/Cargo.toml +++ b/examples/extension-custom-service/Cargo.toml @@ -5,5 +5,4 @@ edition = "2021" [dependencies] lambda-extension = { path = "../../lambda-extension" } -serde = "1.0.217" tokio = { version = "1", features = ["macros"] } diff --git a/examples/extension-logs-basic/Cargo.toml b/examples/extension-logs-basic/Cargo.toml index a4723bf2..230ebc7e 100644 --- a/examples/extension-logs-basic/Cargo.toml +++ b/examples/extension-logs-basic/Cargo.toml @@ -5,5 +5,4 @@ edition = "2021" [dependencies] lambda-extension = { path = "../../lambda-extension" } -serde = "1.0.217" tokio = { version = "1", features = ["macros", "rt"] } diff --git a/examples/extension-logs-custom-service/Cargo.toml b/examples/extension-logs-custom-service/Cargo.toml index 718a9cb3..421fe9ff 100644 --- a/examples/extension-logs-custom-service/Cargo.toml +++ b/examples/extension-logs-custom-service/Cargo.toml @@ -5,5 +5,4 @@ edition = "2021" [dependencies] lambda-extension = { path = "../../lambda-extension" } -serde = "1.0.217" tokio = { version = "1", features = ["macros"] } diff --git a/examples/extension-telemetry-basic/Cargo.toml b/examples/extension-telemetry-basic/Cargo.toml index ecf6991d..a0fb6b87 100644 --- a/examples/extension-telemetry-basic/Cargo.toml +++ b/examples/extension-telemetry-basic/Cargo.toml @@ -5,5 +5,4 @@ edition = "2021" [dependencies] lambda-extension = { path = "../../lambda-extension" } -serde = "1.0.217" tokio = { version = "1", features = ["macros", "rt"] } diff --git a/examples/http-axum-apigw-authorizer/Cargo.toml b/examples/http-axum-apigw-authorizer/Cargo.toml index 6d4a399c..3deb07c8 100644 --- a/examples/http-axum-apigw-authorizer/Cargo.toml +++ b/examples/http-axum-apigw-authorizer/Cargo.toml @@ -6,7 +6,5 @@ edition = "2021" [dependencies] axum = "0.7" lambda_http = { path = "../../lambda-http" } -lambda_runtime = { path = "../../lambda-runtime" } -serde = "1.0.217" serde_json = "1.0" tokio = { version = "1", features = ["macros"] } diff --git a/examples/http-axum-diesel-ssl/Cargo.toml b/examples/http-axum-diesel-ssl/Cargo.toml index 7eaf1232..8d05dd4f 100755 --- a/examples/http-axum-diesel-ssl/Cargo.toml +++ b/examples/http-axum-diesel-ssl/Cargo.toml @@ -8,7 +8,6 @@ axum = "0.7" diesel = "2.2.6" diesel-async = { version = "0.5.2", features = ["postgres", "bb8"] } lambda_http = { path = "../../lambda-http" } -lambda_runtime = { path = "../../lambda-runtime" } serde = "1.0.217" futures-util = "0.3.31" rustls = "0.23.21" diff --git a/examples/http-axum-diesel/Cargo.toml b/examples/http-axum-diesel/Cargo.toml index eefe6afd..05b482aa 100644 --- a/examples/http-axum-diesel/Cargo.toml +++ b/examples/http-axum-diesel/Cargo.toml @@ -8,6 +8,5 @@ axum = "0.7" diesel = "2.2.6" diesel-async = { version = "0.5.2", features = ["postgres", "bb8"] } lambda_http = { path = "../../lambda-http" } -lambda_runtime = { path = "../../lambda-runtime" } serde = "1.0.217" tokio = { version = "1", features = ["macros"] } diff --git a/examples/http-axum-middleware/Cargo.toml b/examples/http-axum-middleware/Cargo.toml index 228fc0ae..4f2ddfee 100644 --- a/examples/http-axum-middleware/Cargo.toml +++ b/examples/http-axum-middleware/Cargo.toml @@ -8,6 +8,5 @@ axum = "0.7" lambda_http = { path = "../../lambda-http", default-features = false, features = [ "apigw_rest", "tracing" ] } -lambda_runtime = { path = "../../lambda-runtime" } serde_json = "1.0" tokio = { version = "1", features = ["macros"] } diff --git a/examples/http-axum/Cargo.toml b/examples/http-axum/Cargo.toml index 0733d46a..8984841b 100644 --- a/examples/http-axum/Cargo.toml +++ b/examples/http-axum/Cargo.toml @@ -6,7 +6,6 @@ edition = "2021" [dependencies] axum = "0.7" lambda_http = { path = "../../lambda-http" } -lambda_runtime = { path = "../../lambda-runtime" } serde = "1.0.217" serde_json = "1.0" tokio = { version = "1", features = ["macros"] } diff --git a/examples/http-basic-lambda/Cargo.toml b/examples/http-basic-lambda/Cargo.toml index c7a51507..2f252389 100644 --- a/examples/http-basic-lambda/Cargo.toml +++ b/examples/http-basic-lambda/Cargo.toml @@ -5,5 +5,4 @@ edition = "2021" [dependencies] lambda_http = { path = "../../lambda-http" } -lambda_runtime = { path = "../../lambda-runtime" } tokio = { version = "1", features = ["macros"] } diff --git a/examples/http-cors/Cargo.toml b/examples/http-cors/Cargo.toml index e7eeefc6..b9c9efa5 100644 --- a/examples/http-cors/Cargo.toml +++ b/examples/http-cors/Cargo.toml @@ -5,6 +5,5 @@ edition = "2021" [dependencies] lambda_http = { path = "../../lambda-http" } -lambda_runtime = { path = "../../lambda-runtime" } tokio = { version = "1", features = ["macros"] } tower-http = { version = "0.6", features = ["cors"] } diff --git a/examples/http-dynamodb/Cargo.toml b/examples/http-dynamodb/Cargo.toml index 62bd9225..015e9f84 100644 --- a/examples/http-dynamodb/Cargo.toml +++ b/examples/http-dynamodb/Cargo.toml @@ -4,7 +4,6 @@ version = "0.1.0" edition = "2021" [dependencies] -simple-error = "0.3.1" serde_json = "1.0.137" serde = { version = "1.0.217", features = ["derive"] } serde_dynamo = { version = "4.2.14", features = ["aws-sdk-dynamodb+1"] } diff --git a/examples/http-query-parameters/Cargo.toml b/examples/http-query-parameters/Cargo.toml index 2cadda95..18f8e6cf 100644 --- a/examples/http-query-parameters/Cargo.toml +++ b/examples/http-query-parameters/Cargo.toml @@ -5,5 +5,4 @@ edition = "2021" [dependencies] lambda_http = { path = "../../lambda-http" } -lambda_runtime = { path = "../../lambda-runtime" } tokio = { version = "1", features = ["macros"] } diff --git a/examples/http-raw-path/Cargo.toml b/examples/http-raw-path/Cargo.toml index f6c56526..d1c5ccb8 100644 --- a/examples/http-raw-path/Cargo.toml +++ b/examples/http-raw-path/Cargo.toml @@ -5,5 +5,4 @@ edition = "2021" [dependencies] lambda_http = { path = "../../lambda-http" } -lambda_runtime = { path = "../../lambda-runtime" } tokio = { version = "1", features = ["macros"] } diff --git a/examples/http-shared-resource/Cargo.toml b/examples/http-shared-resource/Cargo.toml index 923ceecc..8f5a0e94 100644 --- a/examples/http-shared-resource/Cargo.toml +++ b/examples/http-shared-resource/Cargo.toml @@ -5,5 +5,4 @@ edition = "2021" [dependencies] lambda_http = { path = "../../lambda-http" } -lambda_runtime = { path = "../../lambda-runtime" } tokio = { version = "1", features = ["macros"] } diff --git a/examples/http-tower-trace/Cargo.toml b/examples/http-tower-trace/Cargo.toml index dc3b6802..cf1f223b 100644 --- a/examples/http-tower-trace/Cargo.toml +++ b/examples/http-tower-trace/Cargo.toml @@ -5,6 +5,5 @@ edition = "2021" [dependencies] lambda_http = { path = "../../lambda-http" } -lambda_runtime = "0.13.0" tokio = { version = "1", features = ["macros"] } tower-http = { version = "0.6", features = ["trace"] } diff --git a/examples/opentelemetry-tracing/Cargo.toml b/examples/opentelemetry-tracing/Cargo.toml index 18e5926c..9aea3907 100644 --- a/examples/opentelemetry-tracing/Cargo.toml +++ b/examples/opentelemetry-tracing/Cargo.toml @@ -5,11 +5,9 @@ edition = "2021" [dependencies] lambda_runtime = { path = "../../lambda-runtime", features = ["opentelemetry"] } -opentelemetry-semantic-conventions = "0.27" opentelemetry = "0.27" opentelemetry_sdk = { version = "0.27", features = ["rt-tokio"] } opentelemetry-stdout = { version = "0.27", features = ["trace"] } -pin-project = "1" serde_json = "1.0" tokio = "1" tower = "0.5" diff --git a/lambda-extension/Cargo.toml b/lambda-extension/Cargo.toml index dc1834cd..09343da2 100644 --- a/lambda-extension/Cargo.toml +++ b/lambda-extension/Cargo.toml @@ -19,7 +19,6 @@ tracing = ["lambda_runtime_api_client/tracing"] [dependencies] async-stream = "0.3" -bytes = { workspace = true } chrono = { workspace = true, features = ["serde"] } http = { workspace = true } http-body-util = { workspace = true } diff --git a/lambda-http/Cargo.toml b/lambda-http/Cargo.toml index 81e9c047..180de65c 100644 --- a/lambda-http/Cargo.toml +++ b/lambda-http/Cargo.toml @@ -29,15 +29,12 @@ eyre = ["lambda_runtime/eyre"] # enables From for Diagnostic for eyre error t miette = ["lambda_runtime/miette"] # enables From for Diagnostic for miette error types, see README.md for more info [dependencies] -base64 = { workspace = true } bytes = { workspace = true } encoding_rs = "0.8" -futures = { workspace = true } futures-util = { workspace = true } http = { workspace = true } http-body = { workspace = true } http-body-util = { workspace = true } -hyper = { workspace = true } lambda_runtime = { version = "0.13.0", path = "../lambda-runtime" } mime = "0.3" percent-encoding = "2.3" @@ -58,6 +55,5 @@ features = ["alb", "apigw"] axum-core = "0.4.5" axum-extra = { version = "0.9.6", features = ["query"] } lambda_runtime_api_client = { version = "0.11.1", path = "../lambda-runtime-api-client" } -log = "^0.4" maplit = "1.0" tokio = { version = "1.43", features = ["macros"] } diff --git a/lambda-integration-tests/Cargo.toml b/lambda-integration-tests/Cargo.toml index dc6813b5..bafb6a45 100644 --- a/lambda-integration-tests/Cargo.toml +++ b/lambda-integration-tests/Cargo.toml @@ -19,7 +19,6 @@ serde = { version = "1.0.217", features = ["derive"] } [dev-dependencies] reqwest = { version = "0.12.12", features = ["blocking"] } -openssl = { version = "0.10", features = ["vendored"] } [[bin]] name = "helloworld" diff --git a/lambda-runtime-api-client/Cargo.toml b/lambda-runtime-api-client/Cargo.toml index 03c155a3..8db83b84 100644 --- a/lambda-runtime-api-client/Cargo.toml +++ b/lambda-runtime-api-client/Cargo.toml @@ -32,7 +32,7 @@ hyper-util = { workspace = true, features = [ "tokio", ] } tower = { workspace = true, features = ["util"] } -tower-service = { workspace = true } -tokio = { version = "1.43", features = ["io-util"] } tracing = { version = "0.1", features = ["log"], optional = true } tracing-subscriber = { version = "0.3", default-features = false, features = ["fmt", "json", "env-filter"], optional = true } + +[dev-dependencies] diff --git a/lambda-runtime/Cargo.toml b/lambda-runtime/Cargo.toml index 48549777..c64ad69a 100644 --- a/lambda-runtime/Cargo.toml +++ b/lambda-runtime/Cargo.toml @@ -29,16 +29,9 @@ bytes = { workspace = true } eyre = { version = "0.6.12", optional = true } futures = { workspace = true } http = { workspace = true } -http-body = { workspace = true } http-body-util = { workspace = true } http-serde = { workspace = true } hyper = { workspace = true, features = ["http1", "client"] } -hyper-util = { workspace = true, features = [ - "client", - "client-legacy", - "http1", - "tokio", -] } lambda_runtime_api_client = { version = "0.11.1", path = "../lambda-runtime-api-client", default-features = false } miette = { version = "7.4.0", optional = true } opentelemetry-semantic-conventions = { version = "0.27", optional = true, features = ["semconv_experimental"] } @@ -54,17 +47,7 @@ tokio = { version = "1.43", features = [ ] } tokio-stream = "0.1.17" tower = { workspace = true, features = ["util"] } -tower-layer = { workspace = true } tracing = { version = "0.1", features = ["log"] } [dev-dependencies] httpmock = "0.7.0" -hyper-util = { workspace = true, features = [ - "client", - "client-legacy", - "http1", - "server", - "server-auto", - "tokio", -] } -pin-project-lite = { workspace = true } From 3f53ec4c4c41f81c5ff250e9fb824578f058d408 Mon Sep 17 00:00:00 2001 From: Nick Angelou Date: Mon, 20 Jan 2025 13:31:30 +0100 Subject: [PATCH 04/10] add feature flag for aws-config --- .../producer/Cargo.toml | 2 +- examples/basic-cognito-post-confirmation/Cargo.toml | 2 +- examples/basic-s3-object-lambda-thumbnail/Cargo.toml | 2 +- examples/basic-s3-thumbnail/Cargo.toml | 2 +- examples/basic-sdk/Cargo.toml | 2 +- examples/extension-logs-kinesis-firehose/Cargo.toml | 2 +- examples/http-dynamodb/Cargo.toml | 2 +- examples/lambda-rds-iam-auth/Cargo.toml | 2 +- 8 files changed, 8 insertions(+), 8 deletions(-) diff --git a/examples/advanced-sqs-multiple-functions-shared-data/producer/Cargo.toml b/examples/advanced-sqs-multiple-functions-shared-data/producer/Cargo.toml index 4797c807..0a9fe450 100644 --- a/examples/advanced-sqs-multiple-functions-shared-data/producer/Cargo.toml +++ b/examples/advanced-sqs-multiple-functions-shared-data/producer/Cargo.toml @@ -8,7 +8,7 @@ env = { "QUEUE_URL" = "https://changeMe" } [dependencies] #aws dependencies -aws-config = "1.5.14" +aws-config = { version = "1.5.14", features = ["behavior-version-latest"] } aws-sdk-sqs = "1.54.0" #lambda runtime diff --git a/examples/basic-cognito-post-confirmation/Cargo.toml b/examples/basic-cognito-post-confirmation/Cargo.toml index de6b8085..afd44a4f 100644 --- a/examples/basic-cognito-post-confirmation/Cargo.toml +++ b/examples/basic-cognito-post-confirmation/Cargo.toml @@ -15,7 +15,7 @@ edition = "2021" # and it will keep the alphabetic ordering for you. [dependencies] -aws-config = "1.5.14" +aws-config = { version = "1.5.14", features = ["behavior-version-latest"] } aws-sdk-ses = "1.57.0" aws_lambda_events = { path = "../../lambda-events", default-features = false, features = ["cognito"] } diff --git a/examples/basic-s3-object-lambda-thumbnail/Cargo.toml b/examples/basic-s3-object-lambda-thumbnail/Cargo.toml index ef9fc75e..accd209c 100644 --- a/examples/basic-s3-object-lambda-thumbnail/Cargo.toml +++ b/examples/basic-s3-object-lambda-thumbnail/Cargo.toml @@ -18,7 +18,7 @@ edition = "2021" aws_lambda_events = "0.16.0" lambda_runtime = { path = "../../lambda-runtime" } tokio = { version = "1", features = ["macros"] } -aws-config = "1.5.14" +aws-config = { version = "1.5.14", features = ["behavior-version-latest"] } aws-sdk-s3 = "1.69.0" thumbnailer = "0.5.1" mime = "0.3.17" diff --git a/examples/basic-s3-thumbnail/Cargo.toml b/examples/basic-s3-thumbnail/Cargo.toml index a3cb36dc..147a914e 100644 --- a/examples/basic-s3-thumbnail/Cargo.toml +++ b/examples/basic-s3-thumbnail/Cargo.toml @@ -18,7 +18,7 @@ edition = "2021" aws_lambda_events = { path = "../../lambda-events" } lambda_runtime = { path = "../../lambda-runtime" } tokio = { version = "1", features = ["macros"] } -aws-config = "1.5.14" +aws-config = { version = "1.5.14", features = ["behavior-version-latest"] } aws-sdk-s3 = "1.69.0" thumbnailer = "0.5.1" mime = "0.3.17" diff --git a/examples/basic-sdk/Cargo.toml b/examples/basic-sdk/Cargo.toml index c99739f9..fb8513a8 100644 --- a/examples/basic-sdk/Cargo.toml +++ b/examples/basic-sdk/Cargo.toml @@ -7,7 +7,7 @@ edition = "2021" [dependencies] async-trait = "0.1" -aws-config = "1.5.14" +aws-config = { version = "1.5.14", features = ["behavior-version-latest"] } aws-sdk-s3 = "1.69.0" lambda_runtime = { path = "../../lambda-runtime" } serde = "1.0.217" diff --git a/examples/extension-logs-kinesis-firehose/Cargo.toml b/examples/extension-logs-kinesis-firehose/Cargo.toml index 1d37049b..3cdeb6dd 100644 --- a/examples/extension-logs-kinesis-firehose/Cargo.toml +++ b/examples/extension-logs-kinesis-firehose/Cargo.toml @@ -6,5 +6,5 @@ edition = "2021" [dependencies] lambda-extension = { path = "../../lambda-extension" } tokio = { version = "1.43.0", features = ["full"] } -aws-config = "1.5.14" +aws-config = { version = "1.5.14", features = ["behavior-version-latest"] } aws-sdk-firehose = "1.60.0" diff --git a/examples/http-dynamodb/Cargo.toml b/examples/http-dynamodb/Cargo.toml index 015e9f84..d10c098c 100644 --- a/examples/http-dynamodb/Cargo.toml +++ b/examples/http-dynamodb/Cargo.toml @@ -9,5 +9,5 @@ serde = { version = "1.0.217", features = ["derive"] } serde_dynamo = { version = "4.2.14", features = ["aws-sdk-dynamodb+1"] } lambda_http = { path = "../../lambda-http" } aws-sdk-dynamodb = "1.60.0" -aws-config = "1.5.14" +aws-config = { version = "1.5.14", features = ["behavior-version-latest"] } tokio = { version = "1.43.0", features = ["macros"] } diff --git a/examples/lambda-rds-iam-auth/Cargo.toml b/examples/lambda-rds-iam-auth/Cargo.toml index 1b869fd7..6b56e254 100644 --- a/examples/lambda-rds-iam-auth/Cargo.toml +++ b/examples/lambda-rds-iam-auth/Cargo.toml @@ -6,7 +6,7 @@ edition = "2021" [dependencies] lambda_runtime = { path = "../../lambda-runtime" } serde_json = "1.0.137" -aws-config = "1.5.14" +aws-config = { version = "1.5.14", features = ["behavior-version-latest"] } aws-credential-types = "1.2.1" aws-sigv4 = "1.2.7" url = "2.5.4" From f7244fd834f9ce9992ce044da6d3ba7d29e6adf7 Mon Sep 17 00:00:00 2001 From: Nick Angelou Date: Mon, 20 Jan 2025 13:38:37 +0100 Subject: [PATCH 05/10] update axum --- examples/http-axum-apigw-authorizer/Cargo.toml | 2 +- examples/http-axum-apigw-authorizer/src/main.rs | 3 --- examples/http-axum-diesel-ssl/Cargo.toml | 2 +- examples/http-axum-diesel/Cargo.toml | 2 +- examples/http-axum-middleware/Cargo.toml | 2 +- examples/http-axum/Cargo.toml | 2 +- lambda-http/Cargo.toml | 4 ++-- 7 files changed, 7 insertions(+), 10 deletions(-) diff --git a/examples/http-axum-apigw-authorizer/Cargo.toml b/examples/http-axum-apigw-authorizer/Cargo.toml index 3deb07c8..44c50167 100644 --- a/examples/http-axum-apigw-authorizer/Cargo.toml +++ b/examples/http-axum-apigw-authorizer/Cargo.toml @@ -4,7 +4,7 @@ version = "0.1.0" edition = "2021" [dependencies] -axum = "0.7" +axum = "0.8" lambda_http = { path = "../../lambda-http" } serde_json = "1.0" tokio = { version = "1", features = ["macros"] } diff --git a/examples/http-axum-apigw-authorizer/src/main.rs b/examples/http-axum-apigw-authorizer/src/main.rs index 513a6cd8..8adb9024 100644 --- a/examples/http-axum-apigw-authorizer/src/main.rs +++ b/examples/http-axum-apigw-authorizer/src/main.rs @@ -1,5 +1,4 @@ use axum::{ - async_trait, extract::{FromRequest, Request}, http::StatusCode, response::Json, @@ -13,7 +12,6 @@ use std::{collections::HashMap, env::set_var}; struct AuthorizerField(String); struct AuthorizerFields(HashMap); -#[async_trait] impl FromRequest for AuthorizerField where S: Send + Sync, @@ -30,7 +28,6 @@ where } } -#[async_trait] impl FromRequest for AuthorizerFields where S: Send + Sync, diff --git a/examples/http-axum-diesel-ssl/Cargo.toml b/examples/http-axum-diesel-ssl/Cargo.toml index 8d05dd4f..98827228 100755 --- a/examples/http-axum-diesel-ssl/Cargo.toml +++ b/examples/http-axum-diesel-ssl/Cargo.toml @@ -4,7 +4,7 @@ version = "0.1.0" edition = "2021" [dependencies] -axum = "0.7" +axum = "0.8" diesel = "2.2.6" diesel-async = { version = "0.5.2", features = ["postgres", "bb8"] } lambda_http = { path = "../../lambda-http" } diff --git a/examples/http-axum-diesel/Cargo.toml b/examples/http-axum-diesel/Cargo.toml index 05b482aa..5ac39dce 100644 --- a/examples/http-axum-diesel/Cargo.toml +++ b/examples/http-axum-diesel/Cargo.toml @@ -4,7 +4,7 @@ version = "0.1.0" edition = "2021" [dependencies] -axum = "0.7" +axum = "0.8" diesel = "2.2.6" diesel-async = { version = "0.5.2", features = ["postgres", "bb8"] } lambda_http = { path = "../../lambda-http" } diff --git a/examples/http-axum-middleware/Cargo.toml b/examples/http-axum-middleware/Cargo.toml index 4f2ddfee..f3966941 100644 --- a/examples/http-axum-middleware/Cargo.toml +++ b/examples/http-axum-middleware/Cargo.toml @@ -4,7 +4,7 @@ version = "0.1.0" edition = "2021" [dependencies] -axum = "0.7" +axum = "0.8" lambda_http = { path = "../../lambda-http", default-features = false, features = [ "apigw_rest", "tracing" ] } diff --git a/examples/http-axum/Cargo.toml b/examples/http-axum/Cargo.toml index 8984841b..a3052a5c 100644 --- a/examples/http-axum/Cargo.toml +++ b/examples/http-axum/Cargo.toml @@ -4,7 +4,7 @@ version = "0.1.0" edition = "2021" [dependencies] -axum = "0.7" +axum = "0.8" lambda_http = { path = "../../lambda-http" } serde = "1.0.217" serde_json = "1.0" diff --git a/lambda-http/Cargo.toml b/lambda-http/Cargo.toml index 180de65c..cc8c2fd6 100644 --- a/lambda-http/Cargo.toml +++ b/lambda-http/Cargo.toml @@ -52,8 +52,8 @@ default-features = false features = ["alb", "apigw"] [dev-dependencies] -axum-core = "0.4.5" -axum-extra = { version = "0.9.6", features = ["query"] } +axum-core = "0.5.0" +axum-extra = { version = "0.10.0", features = ["query"] } lambda_runtime_api_client = { version = "0.11.1", path = "../lambda-runtime-api-client" } maplit = "1.0" tokio = { version = "1.43", features = ["macros"] } From 5d8d7e39e3c66e4d7a554159e6828e06a4690e18 Mon Sep 17 00:00:00 2001 From: Nick Angelou Date: Mon, 20 Jan 2025 13:43:37 +0100 Subject: [PATCH 06/10] revert derive --- lambda-runtime/src/layers/otel.rs | 1 - 1 file changed, 1 deletion(-) diff --git a/lambda-runtime/src/layers/otel.rs b/lambda-runtime/src/layers/otel.rs index 5598d745..f50f36f7 100644 --- a/lambda-runtime/src/layers/otel.rs +++ b/lambda-runtime/src/layers/otel.rs @@ -8,7 +8,6 @@ use tracing::{field, instrument::Instrumented, Instrument}; /// Tower layer to add OpenTelemetry tracing to a Lambda function invocation. The layer accepts /// a function to flush OpenTelemetry after the end of the invocation. -#[derive(Copy, Clone)] pub struct OpenTelemetryLayer { flush_fn: F, otel_attribute_trigger: OpenTelemetryFaasTrigger, From 7bccca5d013999944d5f9b80c4364a5a78fd990b Mon Sep 17 00:00:00 2001 From: Nick Angelou Date: Mon, 20 Jan 2025 13:44:51 +0100 Subject: [PATCH 07/10] update --- lambda-runtime-api-client/Cargo.toml | 2 -- 1 file changed, 2 deletions(-) diff --git a/lambda-runtime-api-client/Cargo.toml b/lambda-runtime-api-client/Cargo.toml index 8db83b84..341c20bd 100644 --- a/lambda-runtime-api-client/Cargo.toml +++ b/lambda-runtime-api-client/Cargo.toml @@ -34,5 +34,3 @@ hyper-util = { workspace = true, features = [ tower = { workspace = true, features = ["util"] } tracing = { version = "0.1", features = ["log"], optional = true } tracing-subscriber = { version = "0.3", default-features = false, features = ["fmt", "json", "env-filter"], optional = true } - -[dev-dependencies] From b784d45d3c224be3449d2916fb5b52875a3ef08b Mon Sep 17 00:00:00 2001 From: Nick Angelou Date: Mon, 20 Jan 2025 14:00:16 +0100 Subject: [PATCH 08/10] remove ';' --- examples/basic-s3-object-lambda-thumbnail/src/s3.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/basic-s3-object-lambda-thumbnail/src/s3.rs b/examples/basic-s3-object-lambda-thumbnail/src/s3.rs index 5248bbc0..0b4967d3 100644 --- a/examples/basic-s3-object-lambda-thumbnail/src/s3.rs +++ b/examples/basic-s3-object-lambda-thumbnail/src/s3.rs @@ -72,7 +72,7 @@ fn check_error(error: SdkError) { } if err.is_user() { tracing::info!("User error"); - }; + } if err.is_other() { tracing::info!("Other error"); } From 267c79bba78814efc30c14611ffb50320640edb1 Mon Sep 17 00:00:00 2001 From: Nick Angelou Date: Mon, 20 Jan 2025 14:01:22 +0100 Subject: [PATCH 09/10] use aws_config::load_from_env().await; --- .../producer/src/main.rs | 2 +- examples/basic-s3-object-lambda-thumbnail/src/main.rs | 2 +- examples/basic-s3-thumbnail/src/main.rs | 2 +- examples/basic-sdk/src/main.rs | 2 +- examples/extension-logs-kinesis-firehose/src/main.rs | 2 +- examples/http-dynamodb/src/main.rs | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/examples/advanced-sqs-multiple-functions-shared-data/producer/src/main.rs b/examples/advanced-sqs-multiple-functions-shared-data/producer/src/main.rs index 2a70dce3..6a2883f3 100644 --- a/examples/advanced-sqs-multiple-functions-shared-data/producer/src/main.rs +++ b/examples/advanced-sqs-multiple-functions-shared-data/producer/src/main.rs @@ -20,7 +20,7 @@ async fn main() -> Result<(), Error> { // read the queue url from the environment let queue_url = std::env::var("QUEUE_URL").expect("could not read QUEUE_URL"); // build the config from environment variables (fed by AWS Lambda) - let config = aws_config::from_env().load().await; + let config = aws_config::load_from_env().await; // create our SQS Manager let sqs_manager = SQSManager::new(aws_sdk_sqs::Client::new(&config), queue_url); let sqs_manager_ref = &sqs_manager; diff --git a/examples/basic-s3-object-lambda-thumbnail/src/main.rs b/examples/basic-s3-object-lambda-thumbnail/src/main.rs index 90cfeec9..b34122a1 100644 --- a/examples/basic-s3-object-lambda-thumbnail/src/main.rs +++ b/examples/basic-s3-object-lambda-thumbnail/src/main.rs @@ -59,7 +59,7 @@ async fn main() -> Result<(), Error> { // required to enable CloudWatch error logging by the runtime tracing::init_default_subscriber(); - let shared_config = aws_config::from_env().load().await; + let shared_config = aws_config::load_from_env().await; let client = S3Client::new(&shared_config); let client_ref = &client; diff --git a/examples/basic-s3-thumbnail/src/main.rs b/examples/basic-s3-thumbnail/src/main.rs index 279a2b09..8cfbce62 100644 --- a/examples/basic-s3-thumbnail/src/main.rs +++ b/examples/basic-s3-thumbnail/src/main.rs @@ -111,7 +111,7 @@ async fn main() -> Result<(), Error> { // required to enable CloudWatch error logging by the runtime tracing::init_default_subscriber(); - let shared_config = aws_config::from_env().load().await; + let shared_config = aws_config::load_from_env().await; let client = S3Client::new(&shared_config); let client_ref = &client; diff --git a/examples/basic-sdk/src/main.rs b/examples/basic-sdk/src/main.rs index e416728a..6bdd4045 100644 --- a/examples/basic-sdk/src/main.rs +++ b/examples/basic-sdk/src/main.rs @@ -36,7 +36,7 @@ async fn main() -> Result<(), Error> { // required to enable CloudWatch error logging by the runtime tracing::init_default_subscriber(); - let shared_config = aws_config::from_env().load().await; + let shared_config = aws_config::load_from_env().await; let client = S3Client::new(&shared_config); let client_ref = &client; diff --git a/examples/extension-logs-kinesis-firehose/src/main.rs b/examples/extension-logs-kinesis-firehose/src/main.rs index e46c335a..c9d8a2e4 100644 --- a/examples/extension-logs-kinesis-firehose/src/main.rs +++ b/examples/extension-logs-kinesis-firehose/src/main.rs @@ -61,7 +61,7 @@ async fn main() -> Result<(), Error> { // required to enable CloudWatch error logging by the runtime tracing::init_default_subscriber(); - let config = aws_config::from_env().load().await; + let config = aws_config::load_from_env().await; let logs_processor = SharedService::new(FirehoseLogsProcessor::new(Client::new(&config))); Extension::new() diff --git a/examples/http-dynamodb/src/main.rs b/examples/http-dynamodb/src/main.rs index eb3d450f..d290d807 100644 --- a/examples/http-dynamodb/src/main.rs +++ b/examples/http-dynamodb/src/main.rs @@ -58,7 +58,7 @@ async fn main() -> Result<(), Error> { tracing::init_default_subscriber(); //Get config from environment. - let config = aws_config::from_env().load().await; + let config = aws_config::load_from_env().await; //Create the DynamoDB client. let client = Client::new(&config); From f5ae66631f3bdc1baa29c38a9318326312e52c28 Mon Sep 17 00:00:00 2001 From: Nick Angelou Date: Mon, 20 Jan 2025 14:04:57 +0100 Subject: [PATCH 10/10] remove comments --- examples/http-dynamodb/src/main.rs | 5 ----- 1 file changed, 5 deletions(-) diff --git a/examples/http-dynamodb/src/main.rs b/examples/http-dynamodb/src/main.rs index d290d807..3964ad3a 100644 --- a/examples/http-dynamodb/src/main.rs +++ b/examples/http-dynamodb/src/main.rs @@ -74,11 +74,6 @@ pub async fn add_item(client: &Client, item: Item, table: &str) -> Result<(), Er let item = to_item(item)?; let request = client.put_item().table_name(table).set_item(Some(item)); - // .item("username", user_av) - // .item("account_type", type_av) - // .item("age", age_av) - // .item("first_name", first_av) - // .item("last_name", last_av); tracing::info!("adding item to DynamoDB");