Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add aws-lambda as a feature to generated server SDK #3648

Merged
merged 13 commits into from
Jun 20, 2024
6 changes: 6 additions & 0 deletions CHANGELOG.next.toml
Original file line number Diff line number Diff line change
Expand Up @@ -65,3 +65,9 @@ message = "Update MSRV to `1.76.0`"
references = ["smithy-rs#3653"]
meta = { "breaking" = true, "tada" = true, "bug" = false, "target" = "all" }
author = "landonxjames"

[[smithy-rs]]
message = "A feature, `aws-lambda`, is added to the generated SDK to re-export types required for Lambda deployment."
drganjoo marked this conversation as resolved.
Show resolved Hide resolved
references = ["smithy-rs#3643"]
meta = { "breaking" = false, "bug" = true, "tada" = false }
drganjoo marked this conversation as resolved.
Show resolved Hide resolved
author = "drganjoo"
drganjoo marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,14 @@ class ServerRequiredCustomizations : ServerCodegenDecorator {
),
)

rustCrate.mergeFeature(
Feature(
"aws-lambda",
true,
listOf("aws-smithy-http-server/aws-lambda"),
),
)

rustCrate.withModule(ServerRustModule.Types) {
pubUseSmithyPrimitives(codegenContext, codegenContext.model, rustCrate)(this)
rustTemplate(
Expand Down
6 changes: 4 additions & 2 deletions examples/pokemon-service-lambda/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,16 @@

use std::sync::Arc;

use aws_smithy_http_server::{routing::LambdaHandler, AddExtensionLayer};
use aws_smithy_http_server::AddExtensionLayer;

use pokemon_service_common::{
capture_pokemon, check_health, do_nothing, get_pokemon_species, get_server_statistics,
setup_tracing, stream_pokemon_radio, State,
};
use pokemon_service_lambda::get_storage_lambda;
use pokemon_service_server_sdk::{PokemonService, PokemonServiceConfig};
use pokemon_service_server_sdk::{
server::routing::LambdaHandler, PokemonService, PokemonServiceConfig,
};

#[tokio::main]
pub async fn main() {
drganjoo marked this conversation as resolved.
Show resolved Hide resolved
Expand Down