Learn how to setup and run an external adapter on AWS Lambda
Published 27th February 2019 • Updated 27th February 2019Introduction
In order to increase uptime and reduce maintenance overhead, it can be beneficial to use serverless services to execute your Chainlink external adapters. One of these is AWS Lambda, which will run an external adapter on in this guide.
Also read: How to run an External Adapter on GCP
Navigate to the AWS Lambda section of the AWS Console. The quickest method is to click the Services menu and type in Lambda. You will be presented by a form. Make sure you select Author from scratch.
Submit the form to create the function. This may take a few seconds.
Once created, you should be presented a page showing the configuration of your function. This includes your adapter's code, environment variables and other configuration options.
We now have to upload the adapter that you prepared earlier (Prepare external adapter for AWS/GCP).
Under Function code, change Code entry type to Upload a .zip file.
Select the ZIP file you prepared and upload. Also change Handler to what's relevant for your
adapter (in this case, change to index.handler
).
If you need to set Environment variables, you could also do this now. Just enter the keys and values in the panel below.
When done, click Save in the top right corner. The Function code panel should now show the source code of the adapter you uploaded.
Click on the Designer panel to expand it. By default, your function should be selected. If it's not, select it. From the left Add trigger menu, click API Gateway. A new Configure triggers panel should appear.
In the new form that appears, select Create a new API. For security, select Open.
When done, click Add then the Save button you clicked previously. Once completed saving, an API Endpoint URL should appear in the API Gateway panel.
That's it! Your external adapter has now been setup and is ready on AWS Lambda! You should now be ready to proceed to How to link Chainlink to URL endpoint using the URL for your AWS Lambda function.