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
  1. Build your Flogo app (<myApp>) with the Linux/amd64 target. This is because Lambda deployments are Linux-based and building the binary for Linux/amd64 generates the appropriate artifact to deploy in your AWS Lambda function. Refer to "Building the App" section for details on how to build an app.
  2. Add execution permission to the native Linux/amd64 executable that you built. Run chmod +x <myApp>-linux_amd64
  3. You can deploy the <myApp>-linux_amd64 in 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 xxxxxxxxx
    Note: Make sure that the aws-access-key is identical to the one configured in the Flogo Enterprise Web UI for the selected AWS Connection. This is used for validation with the aws-access-key configured as part of the AWS Connection within the Web UI and the value provided here does not overwrite the aws-access-key used while designing the app.
    This approach of deploying to AWS Lambda works only on Linux platforms.
    If you are using a non-Linux environment to design, build and deploy your apps, then use this approach:
    1. Compress the executable and name it <myApp>-linux_amd64.zip in preparation for deploying to AWS Lambda.
    2. Create your Lambda function with go1.x runtime using the AWS Lambda console.
    3. Upload the .zip from step 3 to the Lambda function being created.
    4. Name the function handler the same as your executable name, <myApp>-linux_amd64.
    Refer to the AWS documentation for more details.
    To override app properties used in a Lambda app during runtime, create a .properties or .json file 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
    where MyLambdaApp is the Lambda app name and
    MyLambdaApp-env.properties is the properties file name.
    All properties in the .properties or .json file are passed to Lambda as environment variables.