# AWS Lambda S3 and Image Rekognition Function Project This starter project consists of: * serverless.template - an AWS CloudFormation Serverless Application Model template file for declaring your Serverless functions and other AWS resources * 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 You may also have a test project depending on the options selected. The generated function handler responds to S3 events on an Amazon S3 bucket and if the object is a png or jpg file uses Amazon Rekognition to detect labels. Once the labels are found it adds them as tags to the S3 Object. ## Here are some steps to follow from Visual Studio: To deploy your Serverless application, right click the project in Solution Explorer and select *Publish to AWS Lambda*. To view your deployed application open the Stack View window by double-clicking the stack name shown beneath the AWS CloudFormation node in the AWS Explorer tree. The Stack View also displays the root URL to your published application. ## 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 ``` If already installed check if new version is available. ``` dotnet tool update -g Amazon.Lambda.Tools ``` Execute unit tests ``` cd "BlueprintBaseName.1/test/BlueprintBaseName.1.Tests" dotnet test ``` Deploy function to AWS Lambda ``` cd "BlueprintBaseName.1/src/BlueprintBaseName.1" dotnet lambda deploy-serverless ```