diff --git a/aws-cs-lambda/README.md b/aws-cs-lambda/README.md index 7396ebda6..74dbc7d10 100644 --- a/aws-cs-lambda/README.md +++ b/aws-cs-lambda/README.md @@ -1,9 +1,9 @@ # AWS C# Lambda -This example creates a lambda that does a simple `.toUpper` on the string input and returns it. +This example creates an AWS Lambda function that does a simple `.toUpper` on the string input and returns it. ## Deploying the App -To deploy your infrastructure, follow the below steps. +To deploy your infrastructure, follow the steps below. ### Prerequisites @@ -16,23 +16,35 @@ 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. -```bash -dotnet publish ./DotnetLambda/src/DotnetLambda/ -``` + ```bash + dotnet publish ./DotnetLambda/src/DotnetLambda/ + ``` 2. Execute our Pulumi program to archive our published function output, and create our lambda. -```bash -pulumi up -C ./pulumi -``` - -3. Call our lambda function from the aws cli. -```bash -aws lambda invoke \ ---function-name $(pulumi stack output Lambda -C ./pulumi) \ ---region $(pulumi config get aws:region -C ./pulumi) \ ---payload '"foo"' \ -output.json - -cat output.json # view the output file with your tool of choice -# "FOO" -``` \ No newline at end of file + + ```bash + pulumi up -C ./pulumi + ``` + +3. Call our Lambda function from the AWS CLI with "foo" as the payload. + + ```bash + aws lambda invoke \ + --function-name $(pulumi stack output Lambda -C ./pulumi) \ + --region $(pulumi config get aws:region -C ./pulumi) \ + --cli-binary-format raw-in-base64-out \ + --payload '"foo"' \ + output.json + + cat output.json # view the output file with your tool of choice + # "FOO" + ``` + +6. From there, feel free to experiment. Simply making edits, rebuilding your handler, and running `pulumi up` will update your function. + +7. Afterwards, destroy your stack and remove it: + + ```bash + pulumi destroy --yes + pulumi stack rm --yes + ```