spiff-arena/docs/DevOps_installation_integra.../deploy_aws_lambda.md

3.7 KiB

Deploying a Connector Proxy as an AWS Lambda Function

This guide shows you how to deploy the demo Connector Proxy as an AWS Lambda Function and integrate it with SpiffArena. We will use the Getting Started Guide as the basis for integration, but the steps should easily map to any custom installation.

It is assumed that you have access to log in to the AWS Console and can create/deploy Lambda functions.

Building the Zip

One method of deploying a Lambda function is by uploading a zip file containing the source code or executable. Run the following command in the root of this repository:

make zip

This will create a zip file containing the lambda entry point function and all the dependencies needed to execute the connectors. For this example, the libraries spiffworkflow-proxy for discovering connectors and connector-http, an example connector that provides HTTP get and post requests, are used.

Once make zip completes, connector_proxy_lambda_demo.zip will be available in the repository root.

Creating the Lambda Function

Log in to the AWS Console and navigate to the Lambda section.

Screenshot from 2023-04-06 15-19-35

From there, choose Create function.

Screenshot from 2023-04-06 15-22-39

Opt for Author from scratch and select the most recent Python runtime.

Screenshot from 2023-04-06 15-23-19

Under Advanced Settings, check Enable function URL. For this demo, we will use the NONE auth type to keep things simple.

Screenshot from 2023-04-06 15-24-12

After clicking the Create function button, you will be taken to your new Lambda function:

Screenshot from 2023-04-06 16-02-11

In the bottom right of the first section is a link to your Lambda's function URL. Click it for a hello world response.

Screenshot from 2023-04-06 16-09-08

Deploying the Lambda Function

If you scroll down, you will see a section with the example code created with your Lambda function. We are going to replace this with the contents of our zip file. Choose Upload from and select .zip file.

Screenshot from 2023-04-06 16-09-34

After a confirmation dialog, you will see that your lambda has been updated:

Screenshot from 2023-04-06 16-12-05

Click your function URL again to see a greeting from our deployed Connector Proxy.

Integrating With SpiffArena

Congratulations, your Connector Proxy has been deployed as a Lambda function. For information on configuring SpiffArena to use the new Connector Proxy URL, please see Configure a Connector Proxy.