From dd3ba770f672b8752ece1d58edb6310c9aca0f2b Mon Sep 17 00:00:00 2001 From: Stuart Lang Date: Wed, 4 Jan 2017 00:32:10 +0000 Subject: [PATCH] Added readme and updated yml conf --- .../aws/examples/hello-world/fsharp/README.md | 37 +++++++++++++++++++ .../hello-world/fsharp/serverless.yml | 7 +++- .../templates/aws-fsharp/serverless.yml | 7 +++- 3 files changed, 47 insertions(+), 4 deletions(-) create mode 100644 docs/providers/aws/examples/hello-world/fsharp/README.md diff --git a/docs/providers/aws/examples/hello-world/fsharp/README.md b/docs/providers/aws/examples/hello-world/fsharp/README.md new file mode 100644 index 000000000..7c7de6acb --- /dev/null +++ b/docs/providers/aws/examples/hello-world/fsharp/README.md @@ -0,0 +1,37 @@ + + +# Hello World F# Example + +## Prerequisites + +* Make sure `serverless` is installed. [See installation guide](../../../guide/installation.md). +* [.Net Core 1.0.1 SDK](https://www.microsoft.com/net/download/core) + * 1.1 isn't currently supported by AWS Lambda +* [NodeJS v4 or higher](https://nodejs.org/en/) +* An AWS Account + +## Build and Package + +From the root of this directory, run `build.cmd`, or `build.sh` if on Linux / Mac. + +This will produce your deployment package at `bin/release/netcoreapp1.0/deploy-package.zip`. + +## Deployment and Invocation + +Once packaged, you can follow [these instructions](https://github.com/serverless/serverless#quick-start) to deploy and remotely invoke the function on AWS Lambda. + +In short the commands you will need to run are (from the root of this directory): + +``` +serverless config credentials --provider aws --key {YourAwsAccessKey} --secret {YourAwsSecret} +serverless deploy -v +serverless invoke -f hello -l +serverless remove +``` + +By default this template deploys to us-east-1, you can change that in "serverless.yml" under the `region: us-east-1` key. \ No newline at end of file diff --git a/docs/providers/aws/examples/hello-world/fsharp/serverless.yml b/docs/providers/aws/examples/hello-world/fsharp/serverless.yml index 46732efe6..774d4d5de 100644 --- a/docs/providers/aws/examples/hello-world/fsharp/serverless.yml +++ b/docs/providers/aws/examples/hello-world/fsharp/serverless.yml @@ -46,14 +46,14 @@ provider: # you can add packaging information here package: - artifact: bin/Release/netcoreapp1.0/publish/deploy-package.zip + artifact: bin/Release/netcoreapp1.0/deploy-package.zip # exclude: # - exclude-me.js # - exclude-me-dir/** functions: hello: - handler: FsharpHandlers::AwsDotnetFsharp.Handler::Hello + handler: FsharpHandlers::AwsDotnetFsharp.Handler::hello # The following are a few example events you can configure # NOTE: Please make sure to change your handler code to work with those events @@ -66,6 +66,9 @@ functions: # - schedule: rate(10 minutes) # - sns: greeter-topic # - stream: arn:aws:dynamodb:region:XXXXXX:table/foo/stream/1970-01-01T00:00:00.000 +# - alexaSkill +# - iot: +# sql: "SELECT * FROM 'some_topic'" # Define function environment variables here # environment: diff --git a/lib/plugins/create/templates/aws-fsharp/serverless.yml b/lib/plugins/create/templates/aws-fsharp/serverless.yml index 46732efe6..774d4d5de 100644 --- a/lib/plugins/create/templates/aws-fsharp/serverless.yml +++ b/lib/plugins/create/templates/aws-fsharp/serverless.yml @@ -46,14 +46,14 @@ provider: # you can add packaging information here package: - artifact: bin/Release/netcoreapp1.0/publish/deploy-package.zip + artifact: bin/Release/netcoreapp1.0/deploy-package.zip # exclude: # - exclude-me.js # - exclude-me-dir/** functions: hello: - handler: FsharpHandlers::AwsDotnetFsharp.Handler::Hello + handler: FsharpHandlers::AwsDotnetFsharp.Handler::hello # The following are a few example events you can configure # NOTE: Please make sure to change your handler code to work with those events @@ -66,6 +66,9 @@ functions: # - schedule: rate(10 minutes) # - sns: greeter-topic # - stream: arn:aws:dynamodb:region:XXXXXX:table/foo/stream/1970-01-01T00:00:00.000 +# - alexaSkill +# - iot: +# sql: "SELECT * FROM 'some_topic'" # Define function environment variables here # environment: