Cloud Functions
Last updated
Last updated
A Cloud Function (CF) allow you to extend Reblaze's tools and functionality. Each CF consists of Lua code that can be run at different points in Reblaze's traffic processing.
Cloud Functions are defined here. They are assigned to URLs within the web application in the Security Profiles section of the Web Proxy page.
When creating a Cloud Function, do not rely on Reblaze to validate the code. Please ensure that the code is valid and, ideally, tested before adding it. If the code has errors, undefined behavior can occur when Reblaze attempts to execute it.
The top right of the screen provides a pulldown for selecting a CF for editing, an Add button to create a new CF, and a Save button for saving edits that were made on the currently-displayed CF.
The CF itself consists of a name (for display within the Reblaze interface), an automatically-generated ID, the Code itself, and a specified Phase. The Phases pulldown allows you to specify when the CF will execute:
Request Pre Reblaze: Execute immediately when Reblaze receives an incoming request, before any other processing occurs.
Request Post Reblaze: Execute after Reblaze has finished processing the request, and before it accesses the backend server.
Response Pre Reblaze: Execute when Reblaze receives the response from the backend.
Response Post Reblaze: Execute as the last action before Reblaze sends the response to the client.
Cloud Functions are a very powerful tool. If you need assistance with this feature, please feel free to contact support.