Flynn loves Lambda! I get to work with microservices on a daily basis, those are services I use myself and ones I help our customers build to take advantage of the that serverless brings you. With many services needing to be deployed and continuous updates, I found myself doing the same thing over and over. It is that specific task that frustrates me most; it simply wasn’t as seamless as I thought it could be. serverless benefits In this article, I’ll walk you through how I cut the development time and make deployments easily repeatable like a walk in the park — thanks to the combination of the and a tool called . Serverless Framework Project Flogo What is Flogo? I’m guessing that you know about the Serverless Framework, but you might not know what is. Well, Flogo is an ! Now that we got the tagline out of the way, let’s unwrap that statement a bit. Flogo is written in Go and now that you can run Go on Lambda, you can easily package up your service and run it on Lambda. Flogo provides you with a visual environment to design your service which, overly simplified, means you put a bunch of activities (like sending a message to Amazon SNS) in a row and execute them when an event occurs. Flogo Ultralight Edge Microservices Framework Together with the Serverless Framework, you can configure which events should trigger it, where to deploy it and what kind of resources it is allowed to use without going into the AWS console. The thing I’m personally very excited about is how easy configuration management is and how easy you can move your service to a new stage. Prerequisites In this tutorial, I’ll walk you through creating your app, as well as deploying it using Serverless. You’ll need to have: The and installed Serverless Framework Go An AWS account if you don’t have that done yet, the links will guide you through the steps. Installing the Project Flogo CLI To build the Flogo app, we’ll make use of the Flogo CLI. Install it like so: go get -u github.com/TIBCOSoftware/flogo-cli/... To simplify dependency management, we’re using the Go tool. (Note that strongly recommends using the binary releases that are available on the page.) dep dep releases Creating your app Because of the way works, you’ll need to execute the commands from within your directory. dep ${GOPATH}/src Let’s create a directory called : serverlesslambdaapp cd $GOPATH/src mkdir serverlesslambdaapp And a file in that directory: flogo.json With that done, you’ll need just one command to turn it into a Flogo app that you can use later on to build the executable from: flogo create -f flogo.json lambda The above command will create a directory called , find all the dependencies the flow has, and download them. It might take a few seconds for this command to complete. lambda Now, we can create an executable out of that project. To run in AWS Lambda, we’ll need to embed the in the application to make sure there are no external file dependencies. (You can still make use of environment variables, but we’ll cover that in a different tutorial.) flogo.json The trigger for Lambda, which contains the event information, makes use of a Makefile to build and zip the app. So let’s run: cd lambda flogo build -e -shim my_lambda_trigger After the command there are two important files in the . One file is called ; this is a zipped executable that you can upload to Lambda. The other is simply called , and is the unzipped version. flogo build ./src/lambda handler.zip handler While you could absolutely use the command line tools that AWS provides to deploy your app, or even upload it manually, it’s much easier to automate that part — especially as your app becomes more complex. This is why I love the ❤ Serverless Framework Deploying Apps with Serverless The team at Serverless did an amazing job making deployments and packaging really simple. From here you only need a few steps. The first thing is to create a new Serverless service in the same folder as your file (if you’ve followed along with the commands, you should still be there :-)): flogo.json # Let’s create a serverless service with the same name as the app serverless create -u -p serverlesslambdaapp https://github.com/retgits/flogo-serverless The next step is to copy the over to the newly-created Serverless folder: handler cp src/lambda/handler serverlesslambdaapp/handler This would be an ideal time to update your file with any bucket names, IAM roles, environment variables or anything that you want to configure, because the only thing left is to deploy! serverless.yml # To package up your function before deploying run cd serverlesslambdaapp serverless package # To deploy, which also does the packaging, your function run cd serverlesslambdaapp serverless deploy *Note: this unfortunately only works under Linux or macOS systems, or when using the Windows Subsystem for Linux (WSL). This is because Windows developers may have trouble producing a zip file that marks the binary as executable on Linux. See for more info). here Testing 1… 2… 3… Let’s test the app to make sure that it really deploys to Lambda and runs correctly. After you log into AWS and select ‘Lambda’, you’ll be presented with all the functions you’ve deployed so far. One of them should be called something like . serverlesslambdaapp-dev-hello Click on that, and you’ll see the overview of your function, including a large button that says ‘Test’. Click ‘Test’ to configure a new test event (any input will do), and click ‘Test’ again to run it. If all went well, and why shouldn’t it, your log will show a line like 2018–03–07 00:18:34.735 INFO [activity-tibco-log] — Hello World from Serverless and Flogo testing… Want to try yourself? Excited to try even more things with ? Check out our or the Flogo docs website