Deploying a Flow as a Lambda Function on AWS
After you have created the flow, you can deploy it as a Lambda function on AWS.
Before you begin
The flow should be configured with the ReceiveLambdaInvocation trigger.
To deploy a flow as a Lambda function on AWS:
- Procedure
- Build your
Flogo app (
<myApp>) with theLinux/amd64target. This is because Lambda deployments are Linux-based and building the binary forLinux/amd64generates the appropriate artifact to deploy in your AWS Lambda function. Refer to "Building the App" section for details on how to build an app. - Add execution permission to the native
Linux/amd64executable that you built. Runchmod +x <myApp>-linux_amd64 - You can deploy the
<myApp>-linux_amd64in one of two ways:If you are using a Linux-environment to design, build, and deploy your apps, you can directly run the following command:<LambdaTriggerBinary> --deploy lambda --aws-access-key <secret_key>
For example,myApp-Linux64 --deploy lambda --aws-access-key xxxxxxxxxNote: Make sure that theThis approach of deploying to AWS Lambda works only on Linux platforms.aws-access-keyis identical to the one configured in the Flogo Enterprise Web UI for the selected AWS Connection. This is used for validation with theaws-access-keyconfigured as part of the AWS Connection within the Web UI and the value provided here does not overwrite theaws-access-keyused while designing the app.If you are using a non-Linux environment to design, build and deploy your apps, then use this approach:- Compress the executable and name it
<myApp>-linux_amd64.zipin preparation for deploying to AWS Lambda. - Create your Lambda function with go1.x runtime using the AWS Lambda console.
- Upload the
.zipfrom step 3 to the Lambda function being created. - Name the function handler the same as your executable name,
<myApp>-linux_amd64.
To override app properties used in a Lambda app during runtime, create a.propertiesor.jsonfile containing the properties and their values to override, then use the command./<Lambda-app-name> --deploy --env-config <app-property-file-name>.properties.
For example:./MyLambdaApp --deploy --env-config MyLambdaApp-env.properties
whereMyLambdaAppis the Lambda app name andMyLambdaApp-env.propertiesis the properties file name.
All properties in the.propertiesor.jsonfile are passed to Lambda as environment variables. - Compress the executable and name it