From 986e76610c639b3f5668182263959de4c6b85251 Mon Sep 17 00:00:00 2001 From: Dave Syer Date: Fri, 15 Sep 2017 14:04:45 +0100 Subject: [PATCH] Clarify some things in the AWS adapter --- .../spring-cloud-function-adapter-aws/README.adoc | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/spring-cloud-function-adapters/spring-cloud-function-adapter-aws/README.adoc b/spring-cloud-function-adapters/spring-cloud-function-adapter-aws/README.adoc index 5f9dc281f..5cd47e126 100644 --- a/spring-cloud-function-adapters/spring-cloud-function-adapter-aws/README.adoc +++ b/spring-cloud-function-adapters/spring-cloud-function-adapter-aws/README.adoc @@ -16,8 +16,11 @@ You don't need the Spring Cloud Function Web or Stream adapter at runtime in Lam == Upload +Build the sample under `spring-cloud-function-samples/function-sample-aws` and upload the `-aws` jar file to Lambda. The handler can be `example.Handler` or `org.springframework.cloud.function.adapter.aws.SpringBootStreamHandler` (FQN of the class, _not_ a method reference, although Lambda does accept method references). + +Using the AWS command line tools it looks like this: + ---- -aws lambda create-function --function-name Uppercase --role arn:aws:iam::[USERID]:role/service-role/[ROLE] --zip-file fileb://spring-cloud-function-adapter-sample/target/spring-cloud-function-adapter-sample-1.0.0.BUILD-SNAPSHOT-aws.jar --handler org.springframework.cloud.function.adapter.aws.SpringBootStreamHandler --description "Spring Cloud Function Adapter Example" --runtime java8 --region us-east-1 --timeout 30 --memory-size 1024 --publish +aws lambda create-function --function-name Uppercase --role arn:aws:iam::[USERID]:role/service-role/[ROLE] --zip-file fileb://function-sample-aws/target/function-sample-aws-1.0.0.BUILD-SNAPSHOT-aws.jar --handler org.springframework.cloud.function.adapter.aws.SpringBootStreamHandler --description "Spring Cloud Function Adapter Example" --runtime java8 --region us-east-1 --timeout 30 --memory-size 1024 --publish ---- -The sample should work with `--handler example.Handler` as well (this is an empty subclass of `SpringBootRequestHandler`). If you don't specify the handler that way then the `Handler` class is not used (so you don't need it if you go with the generic `SpringBootStreamHandler` like above).