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.
Note the following points:
-
The flow must be configured with the ReceiveLambdaInvocation trigger.
-
Run and Deploy actions do not deploy Lambda function on the AWS Lambda directly. You must deploy the Lambda function by following the steps in this section.
-
Deploying an app having ReceiveLambdaInvocation trigger on the TIBCO Platform does not deploy the app as a Lambda function on AWS Lambda. You must create a Linux/amd64 binary and deploy the binary by following the steps in this section.
- Procedure
- Build your Flogo app(
<myApp>
) with theLinux/amd64
target. This is because Lambda deployments are Linux-based and building the binary forLinux/amd64
generates the appropriate artifact to deploy in your AWS Lambda function. - Add execution permission to the native
Linux/amd64
executable file that you built. Runchmod +x <myApp>-linux_amd64
- 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 theThis approach of deploying to AWS Lambda works only on Linux platforms.aws-access-key
is identical to the one configured in the Flogo UI for the selected AWS Connection. This is used for validation with theaws-access-key
configured as part of the AWS Connection within the UI and the value provided here does not overwrite theaws-access-key
used while designing the app..JSON
file are passed to Lambda as environment variables.
After successful deployment Lambda function will get created in the AWS Lambda console.
Deploying a Flow as a Lambda Function on AWS using AWS CLI
- Procedure
- Build your
Flogo app (
<myApp>
) with theLinux/amd64
target. This is because Lambda deployments are Linux-based and building the binary forLinux/amd64
generates the appropriate artifact to deploy in your AWS Lambda function. -
Rename the flogo executable to bootstrap (This is mandatory as per new
provided.al2
andprovided.al2023
runtimes). -
Zip the executable.
-
Zip
myFunction.zip
bootstrap. -
Run the AWS CLI:
aws lambda create-function --function-name myFunction \ --runtime provided.al2023 --handler bootstrap \ --architectures x86_64 \ --role arn:aws:iam::111122223333:role/lambda-ex \ --region us-west-2 \ --zip-file fileb://myFunction.zip