improve readme, cleanup
MODIFY
aws-cs-lambda/README.md
aws-cs-lambda/README.md
-# AWS C# Lambda Example
-Creates a lambda that does a simple `.toUpper` on the string input and returns it.
+# AWS C# Lambda
+This example creates a lambda that does a simple `.toUpper` on the string input and returns it.
+## Deploying the App
-## Instructions
+To deploy your infrastructure, follow the below steps.
+
+### Prerequisites
+
+1. [Install Pulumi](https://www.pulumi.com/docs/get-started/install/)
+2. [Configure AWS Credentials](https://www.pulumi.com/docs/intro/cloud-providers/aws/setup/)
+
+### Steps
+
+After cloning this repo, from this working directory, run these commands:
+
+1. Build and publish the lambda function, making the output available to our Pulumi program.
-From this directory:
```bash
-# build publish the lambda function
cd dotnetLambda/src/dotnetLambda/ && dotnet restore && dotnet build && dotnet publish && cd ../../../
```
+2. Execute our Pulumi program to archive our published function output, and create our lambda.
```bash
-# execute the pulumi program to deploy the lambda
cd ./pulumi/ && pulumi up && cd ../
```
+
+3. Call our lambda function from the aws cli.
+```bash
+aws lambda invoke \
+--function-name $(pulumi stack output lambda) \
+--region $(pulumi config get aws:region) \
+--payload '"foo"' \
+output.json
+
+cat output.json
+# "FOO"
+```
\ No newline at end of file

MODIFY
aws-cs-lambda/dotnetLambda/src/dotnetLambda/Readme.md
aws-cs-lambda/dotnetLambda/src/dotnetLambda/Readme.md
-# AWS Lambda Empty Function Project
+# AWS Lambda Starter Function
+This starter function takes a string input, and returns the `toUpper` of it.
-This starter project consists of:
-* Function.cs - class file containing a class with a single function handler method
-* aws-lambda-tools-defaults.json - default argument settings for use with Visual Studio and command line deployment tools for AWS
+This project must be built and published prior to running `pulumi up` so that our pulumi program can create an [Archive](https://www.pulumi.com/docs/reference/pkg/nodejs/pulumi/pulumi/asset/#Archive).
-You may also have a test project depending on the options selected.
-
-The generated function handler is a simple method accepting a string argument that returns the uppercase equivalent of the input string. Replace the body of this method, and parameters, to suit your needs.
-
-## Here are some steps to follow from Visual Studio:
-
-To deploy your function to AWS Lambda, right click the project in Solution Explorer and select *Publish to AWS Lambda*.
-
-To view your deployed function open its Function View window by double-clicking the function name shown beneath the AWS Lambda node in the AWS Explorer tree.
-
-To perform testing against your deployed function use the Test Invoke tab in the opened Function View window.
-
-To configure event sources for your deployed function, for example to have your function invoked when an object is created in an Amazon S3 bucket, use the Event Sources tab in the opened Function View window.
-
-To update the runtime configuration of your deployed function use the Configuration tab in the opened Function View window.
-
-To view execution logs of invocations of your function use the Logs tab in the opened Function View window.
-
-## Here are some steps to follow to get started from the command line:
-
-Once you have edited your template and code you can deploy your application using the [Amazon.Lambda.Tools Global Tool](https://github.com/aws/aws-extensions-for-dotnet-cli#aws-lambda-amazonlambdatools) from the command line.
-
-Install Amazon.Lambda.Tools Global Tools if not already installed.
-```
- dotnet tool install -g Amazon.Lambda.Tools
+```bash
+dotnet build
+dotnet publish
```
-If already installed check if new version is available.
-```
- dotnet tool update -g Amazon.Lambda.Tools
-```
+See the [AWS .NET Lambda documentation](https://aws.amazon.com/blogs/compute/developing-net-core-aws-lambda-functions/) for more.
-Execute unit tests
-```
- cd "BlueprintBaseName/test/BlueprintBaseName.Tests"
- dotnet test
+## About
+Generated with:
+```sh
+dotnet new lambda.EmptyFunction
```
+See the [AWS .NET Lambda documentation](https://aws.amazon.com/blogs/compute/developing-net-core-aws-lambda-functions/) for more C# templates.
-Deploy function to AWS Lambda
-```
- cd "BlueprintBaseName/src/BlueprintBaseName"
- dotnet lambda deploy-function
-```

DELETE
aws-cs-lambda/dotnetLambda/test/dotnetLambda.Tests/FunctionTest.cs
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Threading.Tasks;
-
-using Xunit;
-using Amazon.Lambda.Core;
-using Amazon.Lambda.TestUtilities;
-
-using dotnetLambda;
-
-namespace dotnetLambda.Tests
-{
- public class FunctionTest
- {
- [Fact]
- public void TestToUpperFunction()
- {
-
- // Invoke the lambda function and confirm the string was upper cased.
- var function = new Function();
- var context = new TestLambdaContext();
- var upperCase = function.FunctionHandler("hello world", context);
-
- Assert.Equal("HELLO WORLD", upperCase);
- }
- }
-}

DELETE
aws-cs-lambda/dotnetLambda/test/dotnetLambda.Tests/dotnetLambda.Tests.csproj
-<Project Sdk="Microsoft.NET.Sdk">
- <PropertyGroup>
- <TargetFramework>netcoreapp2.1</TargetFramework>
- </PropertyGroup>
- <ItemGroup>
- <PackageReference Include="Amazon.Lambda.Core" Version="1.1.0" />
- <PackageReference Include="Amazon.Lambda.TestUtilities" Version="1.1.0" />
- <PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.5.0" />
- <PackageReference Include="xunit" Version="2.3.1" />
- <PackageReference Include="xunit.runner.visualstudio" Version="2.3.1" />
- </ItemGroup>
- <ItemGroup>
- <ProjectReference Include="..\..\src\dotnetLambda\dotnetLambda.csproj" />
- </ItemGroup>
-</Project>
\ No newline at end of file

MODIFY
aws-cs-lambda/pulumi/Pulumi.yaml
aws-cs-lambda/pulumi/Pulumi.yaml
-name: evanDotnetAws
+name: lambda
runtime: dotnet
-description: A minimal AWS C# Pulumi program
+description: Basic example of an AWS lambda using C#

improve readme, cleanup