Files
spring-cloud-static/spring-cloud-function/1.0.0.RC2/multi/multi__upload.html
2018-06-04 10:40:50 +01:00

5 lines
2.9 KiB
HTML

<html><head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>13.&nbsp;Upload</title><link rel="stylesheet" type="text/css" href="css/manual-multipage.css"><meta name="generator" content="DocBook XSL Stylesheets V1.78.1"><link rel="home" href="multi_spring-cloud-function.html" title="Spring Cloud Function"><link rel="up" href="multi_spring-cloud-function.html" title="Spring Cloud Function"><link rel="prev" href="multi__build.html" title="12.&nbsp;Build"><link rel="next" href="multi__azure_functions.html" title="14.&nbsp;Azure Functions"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">13.&nbsp;Upload</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="multi__build.html">Prev</a>&nbsp;</td><th width="60%" align="center">&nbsp;</th><td width="20%" align="right">&nbsp;<a accesskey="n" href="multi__azure_functions.html">Next</a></td></tr></table><hr></div><div class="chapter"><div class="titlepage"><div><div><h1 class="title"><a name="_upload" href="#_upload"></a>13.&nbsp;Upload</h1></div></div></div><p>Build the sample under <code class="literal">spring-cloud-function-samples/function-sample-aws</code> and upload the <code class="literal">-aws</code> jar file to Lambda. The handler can be <code class="literal">example.Handler</code> or <code class="literal">org.springframework.cloud.function.adapter.aws.SpringBootStreamHandler</code> (FQN of the class, <span class="emphasis"><em>not</em></span> a method reference, although Lambda does accept method references).</p><p>Using the AWS command line tools it looks like this:</p><pre class="screen">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</pre><p>The input type for the function in the AWS sample is a Foo with a single property called "value". So you would need this to test it:</p><pre class="screen">{
"value": "test"
}</pre></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="multi__build.html">Prev</a>&nbsp;</td><td width="20%" align="center">&nbsp;</td><td width="40%" align="right">&nbsp;<a accesskey="n" href="multi__azure_functions.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">12.&nbsp;Build&nbsp;</td><td width="20%" align="center"><a accesskey="h" href="multi_spring-cloud-function.html">Home</a></td><td width="40%" align="right" valign="top">&nbsp;14.&nbsp;Azure Functions</td></tr></table></div></body></html>